set correct value on connect

This commit is contained in:
2022-04-18 15:08:36 +02:00
parent a857cb7bb4
commit bbeb1eb420

View File

@@ -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: