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
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
;--- SAMD --------------------------------------------------
|
;--- SAMD --------------------------------------------------
|
||||||
[env:adafruit_feather_m0]
|
[env:adafruit_feather_m0_rf]
|
||||||
platform = atmelsam
|
platform = atmelsam
|
||||||
board = adafruit_feather_m0
|
board = adafruit_feather_m0
|
||||||
framework = arduino
|
framework = arduino
|
||||||
@ -25,23 +25,23 @@ build_flags =
|
|||||||
|
|
||||||
|
|
||||||
;--- ESP8266 -----------------------------------------------
|
;--- ESP8266 -----------------------------------------------
|
||||||
[env:nodemcuv2]
|
#[env:nodemcuv2]
|
||||||
platform = espressif8266
|
#platform = espressif8266
|
||||||
board = nodemcuv2
|
#board = nodemcuv2
|
||||||
framework = arduino
|
#framework = arduino
|
||||||
lib_deps =
|
#lib_deps =
|
||||||
WifiManager
|
# WifiManager
|
||||||
knx
|
# knx
|
||||||
|
|
||||||
build_flags =
|
#build_flags =
|
||||||
-DMASK_VERSION=0x57B0
|
# -DMASK_VERSION=0x57B0
|
||||||
-Wno-unknown-pragmas
|
# -Wno-unknown-pragmas
|
||||||
|
|
||||||
;---------------------------------------------------------
|
;---------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
;--- ESP32 -----------------------------------------------
|
;--- ESP32 -----------------------------------------------
|
||||||
[env:esp32dev]
|
[env:esp32dev_ip]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
@ -14,7 +14,7 @@ libdeps_dir = /tmp/libdeps
|
|||||||
src_dir = .
|
src_dir = .
|
||||||
|
|
||||||
;--- SAMD --------------------------------------------------
|
;--- SAMD --------------------------------------------------
|
||||||
[env:adafruit_feather_m0]
|
[env:adafruit_feather_m0_rf]
|
||||||
platform = atmelsam
|
platform = atmelsam
|
||||||
board = adafruit_feather_m0
|
board = adafruit_feather_m0
|
||||||
framework = arduino
|
framework = arduino
|
||||||
@ -34,27 +34,27 @@ build_flags =
|
|||||||
|
|
||||||
|
|
||||||
;--- ESP8266 -----------------------------------------------
|
;--- ESP8266 -----------------------------------------------
|
||||||
[env:nodemcuv2]
|
#[env:nodemcuv2]
|
||||||
platform = espressif8266
|
#platform = espressif8266
|
||||||
board = nodemcuv2
|
#board = nodemcuv2
|
||||||
framework = arduino
|
#framework = arduino
|
||||||
; We consider that the this projects is opened within its project directory
|
; We consider that the this projects is opened within its project directory
|
||||||
; while working with VS Code.
|
; while working with VS Code.
|
||||||
lib_extra_dirs = ../../../
|
#lib_extra_dirs = ../../../
|
||||||
|
|
||||||
lib_deps =
|
#lib_deps =
|
||||||
WifiManager@0.15.0
|
# WifiManager
|
||||||
knx
|
# knx
|
||||||
|
|
||||||
build_flags =
|
#build_flags =
|
||||||
-DMASK_VERSION=0x57B0
|
# -DMASK_VERSION=0x57B0
|
||||||
-Wno-unknown-pragmas
|
# -Wno-unknown-pragmas
|
||||||
|
|
||||||
;---------------------------------------------------------
|
;---------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
;--- ESP32 -----------------------------------------------
|
;--- ESP32 -----------------------------------------------
|
||||||
[env:esp32dev]
|
[env:esp32dev_ip]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
framework = arduino
|
framework = arduino
|
||||||
@ -68,3 +68,4 @@ lib_deps =
|
|||||||
build_flags =
|
build_flags =
|
||||||
-DMASK_VERSION=0x57B0
|
-DMASK_VERSION=0x57B0
|
||||||
-Wno-unknown-pragmas
|
-Wno-unknown-pragmas
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user