aboutsummaryrefslogtreecommitdiff
path: root/source/HoverBitController.h
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2021-02-10 10:56:36 +0100
committerJakob Stendahl <jakob.stendahl@outlook.com>2021-02-10 10:56:36 +0100
commit318d850719a86d58012689143c01dd0edb6263b5 (patch)
treeef253d25d31e4fb429a57a3d1deb3d8f52e483e7 /source/HoverBitController.h
parentf308eb46365a0e8b490e7fa371a53d72a1f41852 (diff)
downloadhoverbit-ble-318d850719a86d58012689143c01dd0edb6263b5.tar.gz
hoverbit-ble-318d850719a86d58012689143c01dd0edb6263b5.zip
:sprakles: Add failsafe code (addressing #5)
Diffstat (limited to 'source/HoverBitController.h')
-rw-r--r--source/HoverBitController.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/HoverBitController.h b/source/HoverBitController.h
index 4963cd1..477e96e 100644
--- a/source/HoverBitController.h
+++ b/source/HoverBitController.h
@@ -27,7 +27,9 @@ DEALINGS IN THE SOFTWARE.
#include <MicroBit.h>
-#define BATTERY_LOW_LIMIT 3500
+#define BATTERY_LOW_LIMIT 3500
+#define FSAFE_TLIM_THROTTLE 1000 // When to cut the throttle
+#define FSAFE_TLIM_ARM 5000 // When to disarm
class HoverBitController {
private:
@@ -40,16 +42,17 @@ class HoverBitController {
int pitch;
int yaw;
int throttle;
- int failSafeC;
+ unsigned long receiveTime;
bool mainController;
bool batteryEmpty;
int batteryMilliVolt;
float batteryFactor;
+ bool failSafe(void);
+
public:
void init(MicroBit* _uBit);
- void failSafe(void);
unsigned int getBatteryVoltage(void);
void AirBit(int Pitch,int Arm,int Roll,int Throttle,int Yaw,int Aux1,int Aux2);
void HoverControl();