File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change
1
+ // ODAS-RELAY-16 Example code
2
+ // Make all 16 lines outputs
3
+ // Blink each line, one at a time
4
+
5
+ #include < Wire.h>
6
+ #include " Adafruit_MCP23017.h"
7
+
8
+ Adafruit_MCP23017 mcp0;
9
+
10
+ void setup () {
11
+ mcp0.begin (0 ); // use default address 0
12
+ TWBR = 12 ; // go to 400 KHz I2C speed mode
13
+
14
+ uint8_t chip;
15
+ uint8_t port;
16
+
17
+ for (chip = 0 ; chip < 1 ; chip++)
18
+ {
19
+ for (port = 0 ; port < 16 ; port++)
20
+ {
21
+ mcp0.pinMode (port, OUTPUT);
22
+ }
23
+ }
24
+ }
25
+
26
+ // Turn the relays on/off one relay at a time
27
+
28
+ void loop () {
29
+
30
+ uint8_t chip;
31
+ uint8_t port;
32
+
33
+ for (port = 0 ; port < 16 ; port++)
34
+ {
35
+ mcp0.digitalWrite (port, HIGH);
36
+ delay (250 );
37
+ mcp0.digitalWrite (port, LOW);
38
+ }
39
+ }
40
+
Original file line number Diff line number Diff line change
1
+ == land-boards ODASRELAY16 Card Example Arduino Source Code Files ==
2
+
3
+ <img src="http://land-boards.com/blwiki/images/2/28/ODAS-RELAY-16-P356-720px.JPG" alt="ODAS-RELAY-16 Card image"></img>
4
+
5
+ * These are Land Boards' [http://land-boards.com/blwiki/index.php?title=ODAS-RELAY-16 ODAS-RELAY-16 card related ] files.
6
+ ** These files were created to exercise our [http://land-boards.com/blwiki/index.php?title=ODAS-RELAY-16 ODAS-RELAY-16 card ].
7
+
8
+ === Files ===
9
+
10
+ ==== DIGIO16I2CLEDS16 ====
11
+
12
+ * Turn on one relay at a time on the [http://land-boards.com/blwiki/index.php?title=ODAS-RELAY-16 ODAS-RELAY-16 card ]
13
+
14
+ === Ownership ===
15
+
16
+ * Some of these files (particularly libraries) were created by others.
17
+ ** There may be newer versions of these libraries "out there".
18
+ ** Some libraries even have the same names but don't work the same.
19
+ * Many of these files were created by us based on the work of others.
20
+
21
+ === Warning ===
22
+
23
+ * Use at your own risk.
24
+ ** If you brick your part or it melt to a puddle, it's on you not us.
You can’t perform that action at this time.
0 commit comments