Changing The Battery Warning Voice?

 
#1

I am building a BB8 and everything is going fine, however I was wondering if there was a way to change the "battery is low" warning. Having BB8 suddenly speak really ruins the whole effect. I was wondering if there was a way to change the warning to something else that would fit more with the BB8 character?.

#2

No. Hard coded firmware alerts are read only.

#3

other solution

1) disable the battery warning

2) setup a voltage divider source vcc to 3.3 v

3) connect the voltage divider to one EZB's ADC port

4) use EZ-Script (loop) to monitor the ADC port, when the value reaches a threshold play sound file.

#4

Ptp, no need for a voltage divider. You can get the ezb voltage with getvoltage() command. Much like you can also get the ezb temp with gettemp().

#5

Or just remove the speaker... Grin

P.S. I just put I piece of paper between the speaker and the EZ-B so it is no longer connecting, I tend to loose stuff...

#6

Thanks guys, i need the speaker to play other sounds, so I will look in to the coding part. cheers!.

#7

The coding part is simple:

You just set a loop that checks getvoltage().

Code:

:start

If (getvoltage() <= [min battery voltage])
#here is where you put commands for what do do on a dead battery.

#put soundboard command here for special noise

Endif

Sleep(2000)

Goto(start)



What you have to remember is if your running servos or things that use lots of power, your battery could drop in voltage temporarily, and then recover. I would avoid putting a halt script or something else in the if commands that could interfere. Instead just wait for the sound to repeatedly play non stop as an indication. You can also write code to do repeated checks before it triggers. This would allow you to add commands that stop functions of the bot.

#8

no hardware mess (voltage divider) and using DJ's tip

something like this:

Code:


:loop

if (GetVoltage() <7)
ControlCommand("Soundboard v4", Track_10, "ignoreScript")
endif

#sleeps 30 seconds
Sleep(30000)

Goto(loop)

#9

Awesome thanks guys!.

#10

Here is a script I have been using for a while now. It checks the voltage to see if it is low 5 times in a row before it declares that the battery is low. Then it goes into the stand position and finally into the sitting position. It runs in it's own script so it can just sit there and monitor the voltage. It checks the voltage in 1 second intervals. Since it has to check for low voltage 5 times in a row, it will be at least 5 seconds from the time the voltage goes too low before the robot will react. I found the 5 times check to be needed to prevent false alerts. So if you increase the time between voltage checks, the robot will take that much longer to react (times 5). Anyway it's better than having JD do faceplants using the normal low battery warnings.

NOTE: I made a couple of changes since I first posted it.

Code:


$TooLow =7.1 #Low voltage point to activate Charging Position
$LowCount =0
$InChargingPosition =False

:CheckVoltage
if(IsConnected(0) =True)
$BattVoltage =GetVoltage()
Print($BattVoltage)

if ($BattVoltage <= $TooLow)
$LowCount++
ELSE
$LowCount =0 #Reset if voltage goes back above $TooLow
endif

if ($LowCount >5) AND ($InChargingPosition =False)
SayEZBWait("My Battery is low")
Stop()
ControlCommand("Auto Position",AutoPositionAction,"Stand")
SayEZBWait("Time for me to sit down.")
ControlCommand("Auto Position",AutoPositionAction,"Sit Down")
Sleep(8000)
$InChargingPosition =True
endif
Sleep(1000) #Change to check voltage less often if desired
Goto(CheckVoltage)
endif