Asked
— Edited

hi there, Im working with the EZB-4 and 21x servos + a lot leds, camera and sensors.. the robot needs a lot power in action. in the same second If my robot says: "my battery is low", he collapse.. I have no time for a reaction. its not good for the optical look.. I dont want scratches.. or a broken arm.. you know. So I need to find a way to programming a better "battery is low warning". or a optical LED.. the best and coolest way is a live status inside the EZ-Robot Software..
thanks Marty
I'm not near a computer right now as I'm out of town and didn't bring it with me, but something like what I posted below should help...
I'm not 100% sure of the syntax in the code above (maybe Rich could confirm), but it should be close enough.
EDIT. Looks like Rich beat me to it.
The If condition needs wrapping in the brackets, you only have half in it. So
However, a less than is better in case something drains it below 6.9 before the script spots it.
Looping the script with a sleep to constantly monitor would help. Or a waitforchange()
You don't need to assign the GetVoltage() to a variable. You can use it by itself.
See post #10
@Rich.
Yeah, I just saw your post. Thanks for clearing that up. I changed the code above to reflect what you said. I have a hard time as it is scripting with a computer, never mind doing it from memory, lol.
@Smarty.
Rich has you covered on this one with the script example he posted. That will get you sorted. Just to explain, in the example, the "x" in "$x" is where you can name a variable to anything you want and use it in your scripts, but not always nessasery.
yahoooo! perfect :-))
thanks a lot
variable not defined in line 2.. sick
IF($voltage = 6.9) or If($GetVoltage<6.9)
is not working
$voltage needs defining first.
Or, use GetVoltage() correctly
hmm.. it says always: variable not defined for both. can you explain what you mean with: $voltage needs defining first. please for dummies