-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix #7 + getAddress() + update examples
- Loading branch information
1 parent
e0f18ea
commit 5bf06af
Showing
15 changed files
with
190 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// FILE: TCA9535_digitalRead.ino | ||
// AUTHOR: Rob Tillaart | ||
// PUPROSE: test TCA9555 library | ||
// URL: https://github.com/RobTillaart/TCA9555 | ||
|
||
|
||
#include "Wire.h" | ||
#include "TCA9555.h" | ||
|
||
|
||
TCA9535 TCA(0x27); | ||
|
||
|
||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
Serial.print("TCA9555_LIB_VERSION: "); | ||
Serial.println(TCA9555_LIB_VERSION); | ||
|
||
Wire.begin(); | ||
TCA.begin(); | ||
|
||
Serial.println("TEST digitalRead(pin)"); | ||
for (int pin = 0; pin < 16; pin++) | ||
{ | ||
int val = TCA.digitalRead(pin); | ||
Serial.print(val); | ||
Serial.print('\t'); | ||
} | ||
Serial.println(); | ||
} | ||
|
||
|
||
void loop() | ||
{ | ||
} | ||
|
||
|
||
// -- END OF FILE -- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// | ||
// FILE: TCA9535_digitalWrite.ino | ||
// AUTHOR: Rob Tillaart | ||
// PUPROSE: test TCA9555 library - TCA9535 derived class | ||
// URL: https://github.com/RobTillaart/TCA9555 | ||
|
||
|
||
#include "Wire.h" | ||
#include "TCA9555.h" | ||
|
||
|
||
TCA9535 TCA(0x27); | ||
|
||
|
||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
Serial.print("TCA9555_LIB_VERSION: "); | ||
Serial.println(TCA9555_LIB_VERSION); | ||
|
||
Wire.begin(); | ||
TCA.begin(); | ||
|
||
Wire.setClock(50); | ||
|
||
Serial.println("TEST digitalWrite(0)"); | ||
for (int i = 0; i < 16; i++) | ||
{ | ||
TCA.digitalWrite(0, i % 2); // alternating HIGH/LOW | ||
Serial.print(i % 2); | ||
Serial.print('\t'); | ||
delay(250); | ||
} | ||
Serial.println(); | ||
Serial.println(); | ||
|
||
Serial.println("TEST digitalWrite(pin)"); | ||
for (int pin = 0; pin < 16; pin++) | ||
{ | ||
TCA.digitalWrite(pin, 1 - pin % 2); // alternating HIGH/LOW | ||
Serial.print(1 - pin % 2); | ||
Serial.print('\t'); | ||
} | ||
Serial.println(); | ||
Serial.println(); | ||
|
||
Serial.println("TEST read back"); | ||
|
||
for (int pin = 0; pin < 16; pin++) | ||
{ | ||
int val = TCA.digitalRead(pin); | ||
Serial.print(val); | ||
Serial.print('\t'); | ||
} | ||
Serial.println(); | ||
Serial.println(); | ||
} | ||
|
||
|
||
void loop() | ||
{ | ||
} | ||
|
||
|
||
// -- END OF FILE -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.