I'm trying the next code:
if analog pin reads 5 volts then turn on led or off.
That's it! thank you guys!
I'm trying the next code:
if analog pin reads 5 volts then turn on led or off.
That's it! thank you guys!
if you are using an arduino operating nominally at 5v, internal VREF is supply (i.e 5V)! your raw analog read on the arduino will be between 0-1023 (10bit resolution)
if you input can fluctuate above 5v, I would suggest that you use a voltage divider output of which goes to your analog input.
e.g voltage divider output (Vout) = Vin/2
Vin = 5V -> Vout 2.5V -> analogRead(x) = 512
for example code, see tutorial here:
if analog pin reads 5 volts then turn on led or off.
What will it read when it is not 5V ?
If it below about 3V then you can use it as a digital pin.
ingMontesco:
I'm trying the next code:
You seem to have forgotten to post your program.
...R
(deleted)
spycatcher2k:
OK - I'm NOT a guy!,
I think the word "guy" has become asexual.
...R