Quote from: Ben Rose on May 16, 2016, 10:51:26 PMDoes the TinyScreen+ (ARM platform) have a similar function?
I have a function we use to grab VCC on the AVR platform-Code Selectint getVCClevel(){
//http://forum.arduino.cc/index.php?topic=133907.0
const long InternalReferenceVoltage = 1100L;
ADMUX = (0<<REFS1) | (1<<REFS0) | (0<<ADLAR) | (1<<MUX3) | (1<<MUX2) | (1<<MUX1) | (0<<MUX0);
delay(1);
ADCSRA |= _BV( ADSC );
while( ( (ADCSRA & (1<<ADSC)) != 0 ) );
int result = (((InternalReferenceVoltage * 1024L) / ADC) + 5L) / 10L;
return result;//this should be in hundredths of a volt
}
You can use this and a general lithium ion discharge curve to guess approximate charge level.
Thanks,
Ben
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Pages1
#1
TinyDuino Processors & TinyShields / Re: Battery charge status/power remaining
August 12, 2016, 01:03:08 AMPages1
SMF spam blocked by CleanTalk