-
Notifications
You must be signed in to change notification settings - Fork 4
Prog_Mode
Mike edited this page May 2, 2023
·
3 revisions
In order to set the Physical Address of your device you must define a Prog-Button and Prog-LED.
Type | Method |
---|---|
Prog-Button | Calling buttonPin |
Build Flag | |
Prog-LED | Calling ledPin |
Build Flag | |
Callbacks |
The default Pin for the Button is always 0
!
The Stack handles the creation of a Interrupt and toggling the Prog-Mode.
There are two ways to define the pin for the Prog-Button.
// pin or GPIO programming button is connected to. Default is 0
knx.buttonPin(PROG_BUTTON_PIN);
// Is the interrupt created in RISING or FALLING signal? Default is RISING
knx.buttonPinInterruptOn(PROG_BUTTON_PIN_INTERRUPT_ON);
You can also set the Pin with a build flag:
build_flags =
-DPIO_FRAMEWORK_ARDUINO_ENABLE_RTTI
-DLWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
-DMASK_VERSION=0x07B0
-DKNX_BUTTON=24
The default Pin for the LED is always LED_BUILDIN
!
There are three ways to set/handle the Prog-LED.
// pin or GPIO the programming led is connected to. Default is LED_BUILDIN
knx.ledPin(PROG_LED_PIN);
// is the led active on HIGH or low? Default is LOW
knx.ledPinActiveOn(PROG_LED_PIN_ACTIVE_ON);
You can also set the Pin with a build flag:
build_flags =
-DPIO_FRAMEWORK_ARDUINO_ENABLE_RTTI
-DLWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
-DMASK_VERSION=0x07B0
-DKNX_LED=24
If you want to display the prog mode other than just a led pin you can add callbacks to setProgLedOnCallback
and setProgLedOffCallback
.
This way you can handle the prog mode display by your own.
For example with an NeoPixel:
void progLedOff() {
pixels.clear();
pixels.show();
}
void progLedOn() {
pixels.setPixelColor(0, pixels.Color(255, 0, 0));
pixels.show();
}
knx.setProgLedOffCallback(progLedOff);
knx.setProgLedOnCallback(progLedOn);