From 93562d1954b07c1a24a06347152d691d9c1ea35a Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Wed, 24 Feb 2021 13:00:16 +0100 Subject: :lipstick: Make bluetooth symbol flash when not connected --- source/main.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/main.cpp b/source/main.cpp index 815d560..27481a9 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -193,7 +193,25 @@ void mainScreen() { bool bDelayElapsed = (uBit.systemTime() - tmpTimer) > 1000; if (bDelayElapsed) { tmpTimer = uBit.systemTime(); } - if (bDelayElapsed && bConnected) { uart->send(ManagedString("B:") + ManagedString(batteryMilliVolt)); } + if (bConnected) { + if (bDelayElapsed) { + uart->send(ManagedString("B:") + ManagedString(batteryMilliVolt)); + } + } else { + if (bDelayElapsed) { + bBLEIndicator = !bBLEIndicator; + uBit.display.clear(); + if (bBLEIndicator) { + MicroBitImage img(bluetoothSymbol); + uBit.display.print(img); + } else { + // Need to actually see this to know if I want to flash only + // blank screen or with battery. + //batteryLevelFullScreen(); + } + } + return; + } switch (displayMainScreenMode) { case OFF: -- cgit v1.2.3