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
In the example...
GetVoltage() Returns the EZ-B v4 Battery Voltage Example: $x = GetVoltage()
In the $x part, the x is replaced with "voltage". This equals to the GetVoltage variable. So basicly your giving the "GetVoltage" variable the name "Voltage" which is called upon within the script. This is defining the variable. But as Rich said, this is not needed as $GetVoltage is already an existing variable code so you can simply use this without having to define a variable.
Smarty, This is what I use. You can add commands you want.
$voltage=GetVoltage() print($voltage) $cputemp=GetCPUtemp() print($cputemp) if (GetVoltage() < 7.0) say("EZB voltage now less than 7 volts") endif
if (GetVoltage() <= 6.7) say("My EZB positronic brain voltage is " + $voltage + " volts, temperature is " + $cputemp + "degrees C") say("Steve, Voltage is now dangerously low, starting automatic shutdown soon, which may result in a neuralnet failure because I will lose the ability to send serial commands to my IRobot drive system. ") endif if (GetVoltage() > 6.7) Say(" I am operating within normal parameters, Thank you father for asking ") say("My EZB positronic brain voltage is " + $voltage + " volts, temperature is " + $cputemp + "degrees C") Say("Steve hope you are doing ok on this " + $dayname + " in " + $monthname ) sleep(1500)
endif
So this won't work for you?...
Minor error in Rich's code. $getvoltage() is not a system variable, it is a command which retreives a value..
code should be:
(with the loops and sleeps etc....)
Alan
Alan spotted my deliberate mistake
Edited post to reflect this.
heh... lessons for the students..
Alan
@Steve G I misunderstood.
is working fine :-) thanks I thought I have to use $voltage=GetVoltage() or If($voltage<6.9)


@Steve S thanks for the script, really cool :-)
hehe