Skip to content

Commit f74b54a

Browse files
committed
ODAS-RELAY-16 example code
1 parent ffb15f8 commit f74b54a

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+

LBCards/ODASRELAY16/README.mediawiki

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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.

0 commit comments

Comments
 (0)