build more sketches

This commit is contained in:
Thomas Kunze 2019-06-04 00:09:40 +02:00
parent 939a80a29f
commit 715aeeec0e
2 changed files with 17 additions and 6 deletions

View File

@ -27,12 +27,13 @@ before_install:
- if [ "$MODE" = "LINUX" ]; then eval "${MATRIX_EVAL}"; fi - if [ "$MODE" = "LINUX" ]; then eval "${MATRIX_EVAL}"; fi
- if [ "$MODE" = "ARDUINO" ]; then source <(curl -SLs "https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh"); fi - if [ "$MODE" = "ARDUINO" ]; then source <(curl -SLs "https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh"); fi
- if [ "$MODE" = "ARDUINO" ]; then downloadArduinoLib FlashStorage "https://github.com/thelsing/FlashStorage/archive/master.zip"; fi - if [ "$MODE" = "ARDUINO" ]; then downloadArduinoLib FlashStorage "https://github.com/thelsing/FlashStorage/archive/master.zip"; fi
- if [ "$MODE" = "ARDUINO" ]; then downloadArduinoLib BSEC "https://github.com/BoschSensortec/BSEC-Arduino-library/archive/master.zip"; fi
# the HDC100X lib is not properly set up in githup so move things around a bit # the HDC100X lib is not properly set up in githup so move things around a bit
- if [ "$MODE" = "ARDUINO" ]; then wget -O HDC100X.zip "https://github.com/RFgermany/HDC100X_Arduino_Library/archive/master.zip"; fi - if [ "$MODE" = "ARDUINO" ]; then wget -O HDC100X.zip "https://github.com/RFgermany/HDC100X_Arduino_Library/archive/master.zip"; fi
- if [ "$MODE" = "ARDUINO" ]; then unzip -d "$HOME/HDC100X" "HDC100X.zip" && f=("$HOME/HDC100X"/*) && mv "$HOME/HDC100X"/*/* "$HOME/HDC100X" && rmdir "${f[@]}" && mv "$HOME/HDC100X" $HOME/arduino_ide/libraries; fi - if [ "$MODE" = "ARDUINO" ]; then unzip -d "$HOME/HDC100X-Master" "HDC100X.zip" && f=("$HOME/HDC100X-Master"/*) && mv "$HOME/HDC100X-Master"/*/* "$HOME/HDC100X-Master" && rmdir "${f[@]}" && mv "$HOME/HDC100X-Master" $HOME/arduino_ide/libraries; fi
- if [ "$MODE" = "ARDUINO" ]; then downloadArduinoLib BSEC "https://github.com/BoschSensortec/BSEC-Arduino-library/archive/master.zip"; fi
- buildExampleSketch() { arduino --verify --board $BOARD $PWD/examples/$1/$1.ino; } - buildExampleSketch() { arduino --verify --board $BOARD $PWD/examples/$1/$1.ino; }
- if [ "$MODE" = "ARDUINO" ]; then ls -lR $HOME/arduino_ide/libraries; fi
install: install:
- if [ "$MODE" = "ARDUINO" ]; then arduino --install-library "WiFiManager"; fi - if [ "$MODE" = "ARDUINO" ]; then arduino --install-library "WiFiManager"; fi
@ -44,6 +45,9 @@ script:
- if [ "$MODE" = "LINUX" ]; then cmake ..; fi - if [ "$MODE" = "LINUX" ]; then cmake ..; fi
- if [ "$MODE" = "LINUX" ]; then make; fi - if [ "$MODE" = "LINUX" ]; then make; fi
- if [ "$MODE" = "ARDUINO" ]; then buildExampleSketch knx-demo; fi - if [ "$MODE" = "ARDUINO" ]; then buildExampleSketch knx-demo; fi
- if [ "$MODE" = "ARDUINO" ]; then buildExampleSketch knx-sonoffS20; fi
- if [ "$MODE" = "ARDUINO" ]; then buildExampleSketch knx-bme680; fi
- if [ "$MODE" = "ARDUINO" ]; then buildExampleSketch knx-hdc1008; fi
notifications: notifications:
email: email:

View File

@ -1,5 +1,7 @@
#include <knx.h> #include <knx.h>
#ifdef ARDUINO_ARCH_ESP8266
#include <WiFiManager.h> #include <WiFiManager.h>
#endif
#define RELAYPIN 12 #define RELAYPIN 12
@ -12,20 +14,22 @@
// callback from switch-GO // callback from switch-GO
void switchCallback(GroupObject& go) void switchCallback(GroupObject& go)
{ {
if (goBlock.objectReadBool()) if (goBlock.value().boolValue())
return; return;
bool value = goSwitch.objectReadBool(); bool value = goSwitch.value();
digitalWrite(RELAYPIN, value); digitalWrite(RELAYPIN, value);
goStatus.objectWrite(value); goStatus.value(value);
} }
void setup() void setup()
{ {
SerialDBG.begin(115200); SerialDBG.begin(115200);
#ifdef ARDUINO_ARCH_ESP8266
WiFiManager wifiManager; WiFiManager wifiManager;
wifiManager.autoConnect("knx-sonoffS20"); wifiManager.autoConnect("knx-sonoffS20");
#endif
// read adress table, association table, groupobject table and parameters from eeprom // read adress table, association table, groupobject table and parameters from eeprom
knx.readMemory(); knx.readMemory();
@ -34,6 +38,9 @@ void setup()
{ {
// register callback for reset GO // register callback for reset GO
goSwitch.callback(switchCallback); goSwitch.callback(switchCallback);
goSwitch.dataPointType(Dpt(1, 0));
goBlock.dataPointType(Dpt(1, 0));
goStatus.dataPointType(Dpt(1, 0));
} }
// start the framework. Will get wifi first. // start the framework. Will get wifi first.