-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update build-CI + issue_20 examples (#24)
* update build-CI + new examples for #20
- Loading branch information
1 parent
6e3d80c
commit e4e0105
Showing
10 changed files
with
221 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,14 @@ name: Arduino CI | |
on: [push, pull_request] | ||
|
||
jobs: | ||
arduino_ci: | ||
runTest: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: Arduino-CI/[email protected] | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.6 | ||
- run: | | ||
gem install arduino_ci | ||
arduino_ci.rb |
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,7 @@ | ||
compile: | ||
# Choosing to run compilation tests on different Arduino platforms | ||
platforms: | ||
# - uno | ||
# - leonardo | ||
# - due | ||
# - zero |
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,100 @@ | ||
// | ||
// FILE: SHT31_two_I2C.ino | ||
// AUTHOR: Rob Tillaart | ||
// VERSION: 0.1.0 | ||
// PURPOSE: demo | ||
// URL: https://github.com/RobTillaart/SHT31 | ||
// | ||
// NOTE: see issue #22 for details | ||
// originally written for a ATSAMD21G18A custom board. | ||
// | ||
|
||
|
||
#include "Wire.h" | ||
#include "SHT31.h" | ||
|
||
|
||
TwoWire myWire(&sercom5, 0, 1); | ||
// TwoWire myWire = Wire1; // test. | ||
|
||
|
||
// note: address reuse on second I2C bus | ||
#define SHT31_ADDRESS_1 0x44 | ||
#define SHT31_ADDRESS_2 0x45 | ||
#define SHT31_ADDRESS_3 0x44 | ||
#define SHT31_ADDRESS_4 0x45 | ||
|
||
|
||
SHT31 sht_1; | ||
SHT31 sht_2; | ||
SHT31 sht_3; | ||
SHT31 sht_4; | ||
|
||
|
||
bool b1, b2, b3, b4; | ||
|
||
|
||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
Serial.println(__FILE__); | ||
Serial.print("SHT31_LIB_VERSION: \t"); | ||
Serial.println(SHT31_LIB_VERSION); | ||
|
||
Wire.begin(); | ||
Wire.setClock(100000); | ||
myWire.begin(); | ||
myWire.setClock(100000); | ||
|
||
// see datasheet for details | ||
pinPeripheral(0, PIO_SERCOM_ALT); | ||
pinPeripheral(1, PIO_SERCOM_ALT); | ||
|
||
b1 = sht_1.begin(SHT31_ADDRESS_1, &Wire); | ||
b2 = sht_2.begin(SHT31_ADDRESS_2, &Wire); | ||
b3 = sht_3.begin(SHT31_ADDRESS_3, &myWire); | ||
b4 = sht_4.begin(SHT31_ADDRESS_4, &myWire); | ||
|
||
// see if they are connected | ||
Serial.print("BEGIN:\t"); | ||
Serial.print(b1); | ||
Serial.print("\t"); | ||
Serial.print(b2); | ||
Serial.print("\t"); | ||
Serial.print(b3); | ||
Serial.print("\t"); | ||
Serial.print(b4); | ||
Serial.print("\t"); | ||
Serial.println(); | ||
} | ||
|
||
|
||
void loop() | ||
{ | ||
// read all sensors that are found | ||
if (b1) sht_1.read(); | ||
if (b2) sht_2.read(); | ||
if (b3) sht_3.read(); | ||
if (b4) sht_4.read(); | ||
|
||
Serial.print(sht_1.getTemperature(), 1); | ||
Serial.print("\t"); | ||
Serial.print(sht_2.getTemperature(), 1); | ||
Serial.print("\t"); | ||
Serial.print(sht_3.getTemperature(), 1); | ||
Serial.print("\t"); | ||
Serial.print(sht_4.getTemperature(), 1); | ||
Serial.print("\t"); | ||
Serial.print(sht_1.getHumidity(), 1); | ||
Serial.print("\t"); | ||
Serial.print(sht_2.getHumidity(), 1); | ||
Serial.print("\t"); | ||
Serial.print(sht_3.getHumidity(), 1); | ||
Serial.print("\t"); | ||
Serial.print(sht_4.getHumidity(), 1); | ||
Serial.println(); | ||
|
||
delay(1000); | ||
} | ||
|
||
// -- 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,7 @@ | ||
compile: | ||
# Choosing to run compilation tests on different Arduino platforms | ||
platforms: | ||
# - uno | ||
# - leonardo | ||
# - due | ||
# - zero |
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: SHT31_two_I2C.ino | ||
// AUTHOR: Rob Tillaart | ||
// VERSION: 0.1.0 | ||
// PURPOSE: demo | ||
// URL: https://github.com/RobTillaart/SHT31 | ||
// | ||
// NOTE: see issue #22 for details | ||
// originally written for a ATSAMD21G18A custom board. | ||
// edited for a board (e.g. ESP32) that has Wire and Wire1 (compiles, not tested) | ||
|
||
|
||
#include "Wire.h" | ||
#include "SHT31.h" | ||
|
||
|
||
// TwoWire myWire(&sercom5, 0, 1); | ||
TwoWire myWire = Wire1; | ||
|
||
|
||
uint8_t addr[4] = { 0x44, 0x45, 0x44, 0x45 }; | ||
TwoWire * wireAr[4] = { &Wire, &Wire, &myWire, &myWire }; | ||
SHT31 sht[4]; | ||
bool b[4]; | ||
|
||
|
||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
Serial.println(__FILE__); | ||
Serial.print("SHT31_LIB_VERSION: \t"); | ||
Serial.println(SHT31_LIB_VERSION); | ||
|
||
Wire.begin(); | ||
Wire.setClock(100000); | ||
myWire.begin(); | ||
myWire.setClock(100000); | ||
|
||
// see datasheet for details | ||
// pinPeripheral(0, PIO_SERCOM_ALT); | ||
// pinPeripheral(1, PIO_SERCOM_ALT); | ||
|
||
for (uint8_t i = 0; i < 4; i++) | ||
{ | ||
b[i] = sht[i].begin(addr[i], wireAr[i]); | ||
} | ||
|
||
// see if they are connected | ||
Serial.print("BEGIN:\t"); | ||
for (uint8_t i = 0; i < 4; i++) | ||
{ | ||
Serial.print(b[i]); | ||
Serial.print("\t"); | ||
} | ||
Serial.println(); | ||
} | ||
|
||
|
||
void loop() | ||
{ | ||
// read all that are found | ||
for (uint8_t i = 0; i < 4; i++) | ||
{ | ||
if (b[i]) sht[i].read(); | ||
} | ||
|
||
for (uint8_t i = 0; i < 4; i++) | ||
{ | ||
Serial.print(sht[i].getTemperature(), 1); | ||
Serial.print("\t"); | ||
} | ||
for (uint8_t i = 0; i < 4; i++) | ||
{ | ||
Serial.print(sht[i].getHumidity(), 1); | ||
Serial.print("\t"); | ||
} | ||
Serial.println(); | ||
|
||
delay(1000); | ||
} | ||
|
||
// -- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name=SHT31 | ||
version=0.3.3 | ||
version=0.3.4 | ||
author=Rob Tillaart <[email protected]> | ||
maintainer=Rob Tillaart <[email protected]> | ||
sentence=Arduino library for the SHT31 temperature and humidity sensor | ||
|