I tryed a lot of things but with no luck. I using Flowcode V5
I have a pic 12F675 powered by a single 4.2v lithium battery.
I need to measure voltage of this battery to change 3 states of a simple led:
If voltage is over 3.7v (read as a byte, for example 227) led is on.
If voltage is minor to 3.69v (read as a byte, for example 226) led is blinking.
If voltage is minor of 3.2v (read as a byte, for example 200) led blinking faster.
I use a voltage divider to take the sample of battery by Pin 6 (GP1/Vref) using a 5k resistor.
I use ADC component conected to ADC GP1.
![Image](https://i.postimg.cc/kDR1GdK8/adcpanel.jpg)
I use a simple component to call ADC and set variable as a byte.
Then I evaluated this variable to make I want.
![Image](https://i.postimg.cc/NyTnVqDR/adcflowchart.jpg)
...
But not work. In deed never I can make work this using single battery to feed pic and evalauating same battery.
Some idea? Thanks a lot.