Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # http://www.lightshowpi.org/
- #
- # SAMPLE CONFIGURATION FILE
- # -------------------------
- # This is a SAMPLE configuration file for the program. This file follows conventions
- # of a python config file. The variables defined below control variable aspects
- # of the program. To use this sample file, copy it to the config directory and rename
- # the file "overrides.cfg". This sample file only contains settings related to making
- # specific functions or hardware work that are outlined in the description below. You can
- # make changes to other settings by modifing the "config/defaults.cfg" file, or by adding
- # them directly to this file. NOTE: Full descriptions for each setting below can be found in
- # the "config/defaults.cfg" file.
- #
- # Author: Chris Usey ([email protected])
- #
- # ----------------------------------------------
- # -- Model B AND mcp23017 Sample Config File --
- # ----------------------------------------------
- # This sample config file can be used as a starting point for configuring your
- # RaspberryPi Model B with a mcp23017 Port Expander to add 16 additional GPIO to your project.
- # This sample configures the RaspberryPi to use 8 GPIO of the RaspberryPi Model B and
- # an additional 16 GPIO of the mcp23017 Port expander for a total of 24 channels.
- # mcp23017 Chip Addressing
- # The following details how you might wire up a mcp23017 port expander to the raspberry Pi
- #
- # RpiPin mcp23017 PINOUT RpiPin
- # _______________|_________________________________|_______________
- # | ___ ___ |
- # | | () | |
- # | GPB0 <-> | 1 28 | <-> GPA7 |
- # | GPB1 <-> | 2 27 | <-> GPA6 |
- # | GPB2 <-> | 3 26 | <-> GPA5 |
- # | GPB3 <-> | 4 25 | <-> GPA4 |
- # | GPB4 <-> | 5 24 | <-> GPA3 |
- # | GPB5 <-> | 6 23 | <-> GPA2 |
- # | GPB6 <-> | 7 23 | <-> GPA1 |
- # | GPB7 <-> | 8 22 | <-> GPA0 |
- # 3.3v | VDD --> | 9 20 | --> INTA |
- # GND | VSS --> | 10 19 | --> INTB |
- # | NC --- | 11 18 | --> RESET | 3.3v
- # 5 (SCL) | SCL --> | 12 17 | <-- A2 | GND
- # 3 (SDA) | SDA <-> | 13 16 | <-- A1 | GND
- # | NC --- | 14 15 | <-- A0 | GND
- # | |________| |
- #
- #
- # PINS A0,A1,A2 determine the address assigned to the device. The diagram above sets the address i2c_address
- # to 0x20. To achieve a different address set the pins as follows:
- #
- # 0x20 = A0(GND) A1(GND) A2(GND)
- # 0x21 = A0(GND) A1(GND) A2(3.3v)
- # 0x22 = A0(GND) A1(3.3v) A2(GND)
- # 0x23 = A0(GND) A1(3.3v) A2(3.3v)
- # 0x24 = A0(3.3v) A1(GND) A2(GND)
- # 0x25 = A0(3.3v) A1(GND) A2(3.3v)
- # 0x26 = A0(3.3v) A1(3.3v) A2(GND)
- # 0x27 = A0(3.3v) A1(3.3v) A2(3.3v)
- [hardware]
- # Enable the mcp23017 port expander and set it's pin base as 65 with a chip address of 0x20
- # for more information on chip addressing see notes above.
- devices = {
- "mcp23017": [
- {
- "pinBase": "65",
- "i2cAddress": "0x20"
- }
- ]
- }
- # GPIO Pins
- gpio_pins = 0,1,2,3,4,5,6,7,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80
Advertisement
Add Comment
Please, Sign In to add comment