File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed
libraries/LandBoards_MCP23008/examples Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ // //////////////////////////////////////////////////////////////////////////
2
+ // I2CIO8Example.cpp - Example code for I2CIO8-8 card
3
+ // Created by Douglas Gilliland. 2015-11-23
4
+ // I2CIO8-8 is a card which has an MCP23008 8-bit port expander
5
+ // Communication with the card is via I2C Two-wire interface
6
+ // Webpage for the card is at:
7
+ // http://land-boards.com/blwiki/index.php?title=I2CIO-8
8
+ // //////////////////////////////////////////////////////////////////////////
9
+
10
+ #include < Wire.h>
11
+ #include < LandBoards_I2CIO8.h>
12
+
13
+ I2CIO8 MyI2CIO8;
14
+
15
+ // //////////////////////////////////////////////////////////////////////////
16
+ // setup() -
17
+ // //////////////////////////////////////////////////////////////////////////
18
+
19
+ void setup ()
20
+ {
21
+ MyI2CIO8.begin (0 ); // use default address 0
22
+ }
23
+
24
+ // //////////////////////////////////////////////////////////////////////////
25
+ // loop() -
26
+ // //////////////////////////////////////////////////////////////////////////
27
+
28
+ void loop ()
29
+ {
30
+ MyI2CIO8.writeLED (LED0, !MyI2CIO8.readJumper (H4JUMPER));
31
+ MyI2CIO8.writeLED (LED1, !MyI2CIO8.readJumper (H5JUMPER));
32
+ MyI2CIO8.writeLED (LED2, !MyI2CIO8.readJumper (H6JUMPER));
33
+ MyI2CIO8.writeLED (LED3, !MyI2CIO8.readJumper (H7JUMPER));
34
+ }
35
+
Original file line number Diff line number Diff line change
1
+ == Land Boards I2CIO-8 Example Files ==
2
+
3
+ * These are the [http://land-boards.com/blwiki/index.php?title=I2CIO8 I2CIO-8 card ] example files.
4
+
5
+ ==== Examples ====
6
+
7
+ * I2CIO8Blink1 - Blink an LED (Requires Adafruit_MCP23008 library)
8
+ * I2CIO8Blink4 - Bounce across 4 LEDs (Requires Adafruit_MCP23008 library)
9
+ * I2CIO8ECHO - Poll the (4) input jumpers and write out to (4) LEDs (Requires Adafruit_MCP23008 library)
10
+ * I2CIO8ECHO2 - Echo the I/O lines by polling the interrupt line (No library required)
11
+ * I2CIO8Example - Uses LandBoards_I2CIO8 library to echo the I/O lines
12
+
13
+ === Ownership ===
14
+
15
+ * Some of these files (particularly libraries) were created by others.
16
+ ** There may be newer versions of these libraries "out there".
17
+ ** Some libraries even have the same names but don't work the same.
18
+ * Many of these files were created by me based on the work of others.
19
+
20
+ === Warning ===
21
+
22
+ * Use at your own risk.
23
+ ** If you brick your part or it melt to a puddle, it's on you not me.
You can’t perform that action at this time.
0 commit comments