From bbeb1eb420b0aa9562bbb53979fc20db7d87071a Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Mon, 18 Apr 2022 15:08:36 +0200 Subject: [PATCH] set correct value on connect --- door-thing-firmware/src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/door-thing-firmware/src/main.cpp b/door-thing-firmware/src/main.cpp index 61face8..8e674ec 100644 --- a/door-thing-firmware/src/main.cpp +++ b/door-thing-firmware/src/main.cpp @@ -58,6 +58,8 @@ void loop() // while the central is still connected to peripheral: bool oldState = digitalRead(SWITCH_PIN); + switchCharacteristic.writeValue(oldState); + while (central.connected()) { // read the switch state: