Please, there are any way to get battery level?
I'm trying to read and show charge by changing color of NeoPixel 3:
(bat_level values on sketch are invented; just for testing...)
Code: Select all
case 16: // plum geek button for battery measurement
PlayAck();
MotorCapBattVolts = 1;
int bat_level;
bat_level = (analogRead(A0));
Serial.print ("Batería = ");
Serial.println (bat_level);
if (bat_level>1000) {
SetPixelRGB( 3, 0, 0, 200);
goto fin;
}
if (bat_level>800) {
SetPixelRGB( 3, 0, 200, 0);
goto fin;
}
if (bat_level>600) {
SetPixelRGB( 3, 200, 200, 0);
goto fin;
}
else (SetPixelRGB( 3, 200, 0, 0));
fin:
delay (250);
OffPixels();
MotorCapBattVolts = 0;
PlayAck();
RxIRRestart(4);
break;
I'm reading every time 1022, 1023 values
R55 is missing; maybe it will be necessary to read a lower level than power voltage?