View Single Post
Old 03-31-2011, 04:54 PM   #17 (permalink)
bobski
EcoModding Apprentice
 
Join Date: Jan 2010
Location: Newark, DE
Posts: 143

'91 CRX - '91 Honda CRX DX
90 day: 34.91 mpg (US)
Thanks: 0
Thanked 14 Times in 14 Posts
Yep. You could set the minimum even lower if you wanted to be able to diagnose bad battery cells or something; 5V maybe? That would be 1V after the divider, or 200 or less when read in code.
Code:
if(analogRead(pin#) < 200) {doButtonAction;}
else {batteryVoltage = analogRead(pin#) / 40.92;}
  Reply With Quote