PWM Servo Feedback (ADC) icon PWM Servo Feedback (ADC) Add ADC positional feedback to hobby PWM servos via minor mod to EZ-B/Arduino; enables real-time position readout, calibration and puppet mirroring Try it →
Asked — Edited

Changing The Battery Warning Voice?

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?.


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.

#9  

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.


$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  
#10  

I really appreciate the code thanks.