Skip to content

Commit 02f2e55

Browse files
committed
more library work
1 parent 28ae80c commit 02f2e55

26 files changed

+828
-64
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// DIGIO32I2C_Blink
2+
// DIGIO32-I2C Example code
3+
// Blink LED
4+
5+
#include "LandBoards_DIGIO32I2C.h"
6+
7+
LandBoards_DIGIO32I2C Dio32;
8+
9+
void setup()
10+
{
11+
Dio32.begin(0);
12+
Dio32.pinMode(0,OUTPUT);
13+
}
14+
15+
// flip the pin #0 up and down
16+
17+
void loop()
18+
{
19+
Dio32.digitalWrite(0, HIGH);
20+
delay(250);
21+
Dio32.digitalWrite(0, LOW);
22+
delay(250);
23+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// DIGIO32-I2C Example code
2+
// Make all 32 lines outputs
3+
// Blink each line, one at a time
4+
5+
#include "LandBoards_DIGIO32I2C.h"
6+
7+
LandBoards_DIGIO32I2C Dio32;
8+
9+
void setup() {
10+
Dio32.begin(0); // use default address 0
11+
uint8_t port;
12+
for (port = 0; port < 32; port++)
13+
Dio32.pinMode(port, OUTPUT);
14+
}
15+
16+
// flip the pin #0 up and down
17+
18+
void loop()
19+
{
20+
uint8_t port;
21+
for (port = 0; port < 32; port++)
22+
{
23+
Dio32.digitalWrite(port, HIGH);
24+
delay(250);
25+
Dio32.digitalWrite(port, LOW);
26+
}
27+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//////////////////////////////////////////////////////////////////////////////////////////
2+
// DIGIO32I2C_DigitalReadSerial
3+
// Reads digital input bit 0 from DIGIO32 and prints the result to the Serial Monitor
4+
// This example code is in the public domain.
5+
// http://www.arduino.cc/en/Tutorial/DigitalReadSerial
6+
//////////////////////////////////////////////////////////////////////////////////////////
7+
// Digital pin has a pushbutton attached to it. Give it a name:
8+
//////////////////////////////////////////////////////////////////////////////////////////
9+
10+
#include "LandBoards_DIGIO32I2C.h"
11+
12+
LandBoards_DIGIO32I2C Dio32;
13+
14+
#define BIT_TO_READ 0
15+
16+
// the setup routine runs once when you press reset:
17+
void setup()
18+
{
19+
Serial.begin(9600); // initialize serial communication at 9600 bits per second:
20+
Dio32.begin(0);
21+
Dio32.pinMode(BIT_TO_READ,INPUT_PULLUP); // make the pushbutton's pin an input:
22+
}
23+
24+
// the loop routine runs over and over again forever:
25+
void loop()
26+
{
27+
int pinState = Dio32.digitalRead(BIT_TO_READ); // read the input pin:
28+
Serial.println(pinState); // print out the state of the button:
29+
delay(1); // delay in between reads for stability
30+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Uses LandBoards_MCP23017 library
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Uses LandBoards_MCP23017 library
Binary file not shown.

LBCards/ODASRELAY16/ODASRELAY16/ODASRELAY16.ino

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// DIGIO16I2C_Blink
2+
// DIGIO-16 Example code
3+
// Blink LED
4+
5+
#include "LandBoards_MCP23017.h"
6+
7+
LandBoards_MCP23017 mcp0;
8+
9+
void setup()
10+
{
11+
mcp0.begin(0);
12+
mcp0.pinMode(0,OUTPUT);
13+
}
14+
15+
// flip the pin #0 up and down
16+
17+
void loop()
18+
{
19+
mcp0.digitalWrite(0, HIGH);
20+
delay(250);
21+
mcp0.digitalWrite(0, LOW);
22+
delay(250);
23+
}

0 commit comments

Comments
 (0)