-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add LORA example - add Multiplexer example - update readme.md - minor edits.
- Loading branch information
1 parent
0a88600
commit 342b04c
Showing
9 changed files
with
136 additions
and
14 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,30 @@ | ||
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 | ||
libraries: | ||
- "AM232X" | ||
- "TCA9548" |
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,82 @@ | ||
// | ||
// FILE: TCA9548_demo_SGP30.ino | ||
// AUTHOR: Rob Tillaart | ||
// PURPOSE: demo TCA9548 I2C multiplexer | ||
// URL: https://github.com/RobTillaart/TCA9548 | ||
// URL: https://github.com/RobTillaart/SGP30 | ||
|
||
|
||
#include "SGP30.h" | ||
#include "TCA9548.h" | ||
|
||
PCA9546 MP(0x70); | ||
uint8_t channels = 0; | ||
|
||
SGP30 living; // channel 0 | ||
SGP30 kitchen; // channel 1 | ||
SGP30 outside; // channel 2 | ||
|
||
uint32_t lastTime = 0; | ||
|
||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
Serial.println(__FILE__); | ||
Serial.print("TCA9548_LIB_VERSION: "); | ||
Serial.println(TCA9548_LIB_VERSION); | ||
Serial.print("SGP30_LIB_VERSION: "); | ||
Serial.println(SGP30_LIB_VERSION); | ||
Serial.println(); | ||
|
||
Wire.begin(); | ||
// initialize multiplexer | ||
if (MP.begin() == false) | ||
{ | ||
Serial.println("Multiplexer error"); | ||
} | ||
channels = MP.channelCount(); | ||
|
||
// initialize the temperature sensors | ||
MP.selectChannel(0); | ||
if (living.begin() == false) | ||
{ | ||
Serial.println("living error"); | ||
} | ||
MP.selectChannel(1); | ||
if (kitchen.begin() == false ) | ||
{ | ||
Serial.println("kitchen error"); | ||
} | ||
MP.selectChannel(2); | ||
if (outside.begin() == false ) | ||
{ | ||
Serial.println("outside error"); | ||
} | ||
} | ||
|
||
|
||
void loop() | ||
{ | ||
if ((millis() - lastTime) > 5000) | ||
{ | ||
lastTime = millis(); | ||
|
||
MP.selectChannel(0); | ||
living.read(); | ||
Serial.print(living.getCO2(), 1); | ||
Serial.print("\t"); | ||
|
||
MP.selectChannel(1); | ||
kitchen.read(); | ||
Serial.print(kitchen.getCO2(), 1); | ||
Serial.print("\t"); | ||
|
||
MP.selectChannel(2); | ||
outside.read(); | ||
Serial.print(outside.getCO2(), 1); | ||
Serial.print("\n"); | ||
} | ||
} | ||
|
||
|
||
// -- 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