and what do you think about charging battery from Pico? I thought to use voltage divider and then connect it to analog pin to read it and "stop" fet from charging by software,
would my code be ok for this?
function stop(){
digitalWrite(B0,1);
}
function charge(){
digitalWrite(B0,0);
}
function check(){
var a = analogRead(A5)*E.getAnalogVRef()*2;
console.log(a);
if(a>3.7) stop();
else if(a<3.71) charge();
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Thanks Gordon,
and what do you think about charging battery from Pico? I thought to use voltage divider and then connect it to analog pin to read it and "stop" fet from charging by software,
would my code be ok for this?