From e9a5544db7be5e461b92743b37adcc77162483b7 Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Sun, 28 Feb 2021 14:30:49 +0100 Subject: :sparkles: Make it possible for app to controll display mode --- source/main.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/source/main.cpp b/source/main.cpp index 3c3f626..6f3332b 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -70,7 +70,12 @@ void onDelim(MicroBitEvent) { if (i >= length - 1) { bEOC = true; valLength = i - startI + 1; - } else if (cChar == 'R' || cChar == 'T' || cChar == 'A' || cChar == 'S') { + } else if (cChar == 'R' || // Roll + cChar == 'T' || // Throttle + cChar == 'A' || // Arm + cChar == 'S' || // (Servo1) Keeping this for compatability + cChar == 'D' // DisplayMainScreenMode + ) { bEOC = true; valLength = i - startI; } @@ -88,6 +93,18 @@ void onDelim(MicroBitEvent) { } else if (cCommand == 'A') { controller.Arm(value == 1); accString = accString + ManagedString("A") + ManagedString(controller.Arm()); + } else if (cCommand == 'D') { + switch (value) { + case 0: + hoverBitDisplay.mode(GRAPHS); + break; + case 1: + hoverBitDisplay.mode(BATTERY); + break; + case 2: + hoverBitDisplay.mode(OFF); + break; + } } else { // We ignore it :) } -- cgit v1.2.3