mirror of
https://github.com/usatiuk/door-thing.git
synced 2025-10-26 11:17:47 +01:00
set correct value on connect
This commit is contained in:
@@ -58,6 +58,8 @@ void loop()
|
|||||||
|
|
||||||
// while the central is still connected to peripheral:
|
// while the central is still connected to peripheral:
|
||||||
bool oldState = digitalRead(SWITCH_PIN);
|
bool oldState = digitalRead(SWITCH_PIN);
|
||||||
|
switchCharacteristic.writeValue(oldState);
|
||||||
|
|
||||||
while (central.connected())
|
while (central.connected())
|
||||||
{
|
{
|
||||||
// read the switch state:
|
// read the switch state:
|
||||||
|
|||||||
Reference in New Issue
Block a user