Miscellaneous Utility Plugin icon Miscellaneous Utility Plugin — ARC utilities: DataQuery for SQL/ODBC/OLEDB/Excel with parameterized queries returning array variables; Ticks/Millis timing functions. 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

Stay at the forefront of robot programming innovation with ARC Pro, ensuring your robot is always equipped with the latest advancements.

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#9  

You can turn this into a c# plugin quite easily