MPU6050 Tilt Angle Sensor icon MPU6050 Tilt Angle Sensor — Flash Arduino Uno firmware to read DHT11 temp/humidity and MPU6050 IMU simultaneously; provides $AngleX, $AngleY and $AngleZ variables. Try it →
Singapore
Asked — Edited

Help Prevent Jf Faceplanting

Hi all,

When my JD decides that his battery level is low, he lurches forward from a standing position and does a spectacular faceplant on my desk or floor!

To prevent the poor guy cracking his face, I was hoping to script an early warning system that would advise me when he was approaching critical level so I could at least lay him down flat first.

If I recall correctly, the battery warning cuts in at around 6.6 volts so I wrote this small code snippet which runs after connection to alert me when the voltage dipped below 7 volts.


:loop
$batteryLevel=GetVoltage() 
if ($batteryLevel < 7)
ControlCommand("Soundboard v4", Track_12) 
endif 
sleep( 60000 )
Goto (loop)

Track 12 is an audio file that advises 'Energy Cell Exhausted' (I know many of you will guess where that came from:) ).

Whilst the script works, it is not reliably firing off before JD complains his battery level is low and does his faceplant thing.

Can anyone suggest a better method of achieving an early warning alert?

Thanks.


ARC Pro

Upgrade to ARC Pro

Unleash your robot's full potential with the cutting-edge features and intuitive programming offered by Synthiam ARC Pro.

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#9  

You can turn this into a c# plugin quite easily