mirror of
https://github.com/thelsing/knx.git
synced 2025-08-17 13:47:28 +02:00
Add demo-coupler for MCUs
This commit is contained in:
parent
e544824042
commit
28d0f7ada9
38
examples/knx-demo-coupler/knx-demo.ino
Normal file
38
examples/knx-demo-coupler/knx-demo.ino
Normal file
@ -0,0 +1,38 @@
|
||||
#include <knx.h>
|
||||
|
||||
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;
|
||||
}
|
43
examples/knx-demo-coupler/platformio-ci.ini
Normal file
43
examples/knx-demo-coupler/platformio-ci.ini
Normal file
@ -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
|
56
examples/knx-demo-coupler/platformio.ini
Normal file
56
examples/knx-demo-coupler/platformio.ini
Normal file
@ -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
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user