SOLVED: n00b problem, can't get analogRead to work


i'm relatively new programmer, working on adafruit trinket board arduino ide. i've written program read voltage (0-5v) input pin 2, , cause led blink depending on voltage level. if voltage less 1v, red led should blink; if greater 1.14, green 1 should blink; otherwise, nothing should happen. seems analogread function not working; have checked voltage source , confirmed voltage in fact getting board. when run program, red led blinks, no matter input voltage is. because blinks, know program looping should; it's not reading voltage. unfortunately, trinket board not support serial monitor function; if did, make easier. can see obvious did wrong?

my code: https://drive.google.com/file/d/0bxkzanp3mkf6dgxwvudfcktecfe/edit?usp=sharing

my circuit: https://drive.google.com/file/d/0bxkzanp3mkf6u0dntxhjrnpxakk/edit?usp=sharing

trinket pinout: https://learn.adafruit.com/introducing-trinket/pinouts

the files on google drive not public, or something.
post schematic , code here on forums.


Arduino Forum > Using Arduino > Programming Questions > SOLVED: n00b problem, can't get analogRead to work


arduino

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support