readBatteryVoltage()
Get battery voltage
Return Values
Parameters
Type
Description
number
float
Voltage value, range 0 ~ 8.4V
Example
Use uKit Explore v2 board, connect the battery and servo ID-1, and then turn on the switch. When the battery voltage is less than 7.2V, set the buzzer to give alarm, set the RGB LED to red light and stop the servo motor, the program no longer runs. If it is greater than 7.2V, the servo continues to rotate.
Last updated