diff --git a/examples/knx-demo-coupler/knx-demo.ino b/examples/knx-demo-coupler/knx-demo.ino new file mode 100644 index 0000000..6e29bcc --- /dev/null +++ b/examples/knx-demo-coupler/knx-demo.ino @@ -0,0 +1,38 @@ +#include + +void setup() +{ + Serial.begin(115200); + ArduinoPlatform::SerialDebug = &Serial; + + randomSeed(millis()); + + // read adress table, association table, groupobject table and parameters from eeprom + knx.readMemory(); + + // print values of parameters if device is already configured + if (knx.configured()) + { + Serial.println("Coupler configured."); + } + + // pin or GPIO the programming led is connected to. Default is LED_BUILTIN + // knx.ledPin(LED_BUILTIN); + // is the led active on HIGH or low? Default is LOW + // knx.ledPinActiveOn(HIGH); + // pin or GPIO programming button is connected to. Default is 0 + // knx.buttonPin(0); + + // start the framework. + knx.start(); +} + +void loop() +{ + // don't delay here to much. Otherwise you might lose packages or mess up the timing with ETS + knx.loop(); + + // only run the application code if the device was configured with ETS + if (!knx.configured()) + return; +} diff --git a/examples/knx-demo-coupler/platformio-ci.ini b/examples/knx-demo-coupler/platformio-ci.ini new file mode 100644 index 0000000..d60d002 --- /dev/null +++ b/examples/knx-demo-coupler/platformio-ci.ini @@ -0,0 +1,43 @@ +;PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +;--- SAMD -------------------------------------------------- +[env:adafruit_feather_m0_tp_rf] +platform = atmelsam +board = adafruit_feather_m0 +framework = arduino +lib_deps = + SPI + https://github.com/thelsing/FlashStorage.git + knx + +build_flags = + -DMASK_VERSION=0x2920 + -Wno-unknown-pragmas + +;----------------------------------------------------------- + + +;--- ESP8266 ----------------------------------------------- + +;--------------------------------------------------------- + + +;--- ESP32 ----------------------------------------------- +[env:esp32dev_ip_tp] +platform = espressif32 +board = esp32dev +framework = arduino +lib_deps = + knx + +build_flags = + -DMASK_VERSION=0x091A + -Wno-unknown-pragmas diff --git a/examples/knx-demo-coupler/platformio.ini b/examples/knx-demo-coupler/platformio.ini new file mode 100644 index 0000000..7021f1b --- /dev/null +++ b/examples/knx-demo-coupler/platformio.ini @@ -0,0 +1,56 @@ +;PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html +[platformio] +; We have to keep libdeps dir out the project directory otherwise, +; library scanner seems to have issues so compilation fails +libdeps_dir = /tmp/libdeps +src_dir = . + +;--- SAMD -------------------------------------------------- +[env:adafruit_feather_m0_tp_rf] +platform = atmelsam +board = adafruit_feather_m0 +framework = arduino +; We consider that the this projects is opened within its project directory +; while working with VS Code. +lib_extra_dirs = ../../../ + +lib_deps = + SPI + https://github.com/thelsing/FlashStorage.git + knx + +build_flags = + -DMASK_VERSION=0x2920 + -Wno-unknown-pragmas + +;----------------------------------------------------------- + + +;--- ESP8266 ----------------------------------------------- + +;--------------------------------------------------------- + + +;--- ESP32 ----------------------------------------------- +[env:esp32dev_ip_tp] +platform = espressif32 +board = esp32dev +framework = arduino +; We consider that the this projects is opened within its project directory +; while working with VS Code. +lib_extra_dirs = ../../../ + +lib_deps = + knx + +build_flags = + -DMASK_VERSION=0x091A + -Wno-unknown-pragmas diff --git a/examples/knx-demo/platformio-ci.ini b/examples/knx-demo/platformio-ci.ini index d0ba265..e9c4b1a 100644 --- a/examples/knx-demo/platformio-ci.ini +++ b/examples/knx-demo/platformio-ci.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html ;--- SAMD -------------------------------------------------- -[env:adafruit_feather_m0] +[env:adafruit_feather_m0_rf] platform = atmelsam board = adafruit_feather_m0 framework = arduino @@ -25,23 +25,23 @@ build_flags = ;--- ESP8266 ----------------------------------------------- -[env:nodemcuv2] -platform = espressif8266 -board = nodemcuv2 -framework = arduino -lib_deps = - WifiManager - knx +#[env:nodemcuv2] +#platform = espressif8266 +#board = nodemcuv2 +#framework = arduino +#lib_deps = +# WifiManager +# knx -build_flags = - -DMASK_VERSION=0x57B0 - -Wno-unknown-pragmas +#build_flags = +# -DMASK_VERSION=0x57B0 +# -Wno-unknown-pragmas ;--------------------------------------------------------- ;--- ESP32 ----------------------------------------------- -[env:esp32dev] +[env:esp32dev_ip] platform = espressif32 board = esp32dev framework = arduino diff --git a/examples/knx-demo/platformio.ini b/examples/knx-demo/platformio.ini index 08eb874..a831e1b 100644 --- a/examples/knx-demo/platformio.ini +++ b/examples/knx-demo/platformio.ini @@ -14,7 +14,7 @@ libdeps_dir = /tmp/libdeps src_dir = . ;--- SAMD -------------------------------------------------- -[env:adafruit_feather_m0] +[env:adafruit_feather_m0_rf] platform = atmelsam board = adafruit_feather_m0 framework = arduino @@ -34,27 +34,27 @@ build_flags = ;--- ESP8266 ----------------------------------------------- -[env:nodemcuv2] -platform = espressif8266 -board = nodemcuv2 -framework = arduino +#[env:nodemcuv2] +#platform = espressif8266 +#board = nodemcuv2 +#framework = arduino ; We consider that the this projects is opened within its project directory ; while working with VS Code. -lib_extra_dirs = ../../../ +#lib_extra_dirs = ../../../ -lib_deps = - WifiManager@0.15.0 - knx +#lib_deps = +# WifiManager +# knx -build_flags = - -DMASK_VERSION=0x57B0 - -Wno-unknown-pragmas +#build_flags = +# -DMASK_VERSION=0x57B0 +# -Wno-unknown-pragmas ;--------------------------------------------------------- ;--- ESP32 ----------------------------------------------- -[env:esp32dev] +[env:esp32dev_ip] platform = espressif32 board = esp32dev framework = arduino @@ -68,3 +68,4 @@ lib_deps = build_flags = -DMASK_VERSION=0x57B0 -Wno-unknown-pragmas +