Pages: 1 [2]   Go Down
Author Topic: Brand New Arduino Ethernet Analog Pins  (Read 715 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24325
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
if (anHeight>analogRead(an)>anLow){
Are you aware of the left-to-right evaluation rule?
Should there be two comparisons and an "&&" there instead?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It works like this too.. But not this is the question.
Logged

0
Offline Offline
Tesla Member
***
Karma: 114
Posts: 8921
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok thank you for the adveices, I will coretct the fails, but now i don't know how can I measure the 0 volt (standby state of alarm zone response led)

If you are getting random voltages when the alarm output is 0, add a high value pull down resistor (maybe 50k or 100k) with one end of the resistor connected between the alarm output and the arduino analog input pin, and the other end of the resistor connected to the arduino ground.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
    if (anHeight>analogRead(an)>anLow){

It works like this too.. But not this is the question.

It should be. That won't do what it looks to you like it is doing. Fix it, I suggest.
Logged

Pages: 1 [2]   Go Up
Jump to: