-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update readme.md (interrupts) + examples (#49)
- Update readme with advanced interrupts insights - kudos to ddowling for testing. - add example - fix URL examples - add Wire1 example (ESP32 + RP2040)
- Loading branch information
1 parent
b89253b
commit bb15c05
Showing
22 changed files
with
465 additions
and
176 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
platforms: | ||
rpipico: | ||
board: rp2040:rp2040:rpipico | ||
package: rp2040:rp2040 | ||
gcc: | ||
features: | ||
defines: | ||
- ARDUINO_ARCH_RP2040 | ||
warnings: | ||
flags: | ||
|
||
packages: | ||
rp2040:rp2040: | ||
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json | ||
|
||
compile: | ||
# Choosing to run compilation tests on 2 different Arduino platforms | ||
platforms: | ||
# - uno | ||
# - due | ||
# - zero | ||
# - leonardo | ||
# - m4 | ||
- esp32 | ||
# - esp8266 | ||
# - mega2560 | ||
- rpipico |
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,81 @@ | ||
// | ||
// FILE: PCF8574_Wire1.ino | ||
// AUTHOR: Rob Tillaart | ||
// DATE: 2016-04-30 | ||
// PURPOSE: demo | ||
// URL: https://github.com/RobTillaart/PCF8574 | ||
|
||
|
||
#include "PCF8574.h" | ||
|
||
// adjust addresses if needed | ||
PCF8574 PCF(0x39, &Wire1); | ||
|
||
|
||
void doHigh() | ||
{ | ||
PCF.write(4, HIGH); | ||
int x = PCF.read8(); | ||
Serial.print("Read "); | ||
Serial.println(x, HEX); | ||
} | ||
|
||
|
||
void doLow() | ||
{ | ||
PCF.write(4, LOW); | ||
int x = PCF.read8(); | ||
Serial.print("Read "); | ||
Serial.println(x, HEX); | ||
} | ||
|
||
|
||
void doToggle() | ||
{ | ||
PCF.toggle(4); | ||
int x = PCF.read8(); | ||
Serial.print("Read "); | ||
Serial.println(x, HEX); | ||
} | ||
|
||
|
||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
Serial.println(__FILE__); | ||
Serial.print("PCF8574_LIB_VERSION:\t"); | ||
Serial.println(PCF8574_LIB_VERSION); | ||
|
||
Wire1.begin(); | ||
|
||
if (!PCF.begin()) | ||
{ | ||
Serial.println("could not initialize..."); | ||
} | ||
if (!PCF.isConnected()) | ||
{ | ||
Serial.println("=> not connected"); | ||
while(1); | ||
} | ||
|
||
int x = PCF.read8(); | ||
Serial.print("Read "); | ||
Serial.println(x, HEX); | ||
delay(1000); | ||
} | ||
|
||
|
||
void loop() | ||
{ | ||
Serial.println("HLT"); | ||
while (Serial.available() == 0); | ||
switch (Serial.read()) | ||
{ | ||
case 'H': doHigh(); break; | ||
case 'L': doLow(); break; | ||
case 'T': doToggle(); break; | ||
} | ||
} | ||
|
||
|
||
// -- 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 |
---|---|---|
@@ -1,9 +1,27 @@ | ||
platforms: | ||
rpipico: | ||
board: rp2040:rp2040:rpipico | ||
package: rp2040:rp2040 | ||
gcc: | ||
features: | ||
defines: | ||
- ARDUINO_ARCH_RP2040 | ||
warnings: | ||
flags: | ||
|
||
packages: | ||
rp2040:rp2040: | ||
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json | ||
|
||
compile: | ||
# Choosing to run compilation tests on 2 different Arduino platforms | ||
platforms: | ||
# example made for Teensy a.o. | ||
# | ||
# - uno | ||
# - leonardo | ||
# - due | ||
# - zero | ||
# - leonardo | ||
# - m4 | ||
# - esp32 | ||
# - esp8266 | ||
# - mega2560 | ||
# - rpipico |
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.