Go Down

Topic: Ping))) (Read 1 time) previous topic - next topic

PaulS

Quote
Thank you. I have read about a code: if (........==.......). Can i use this code?

You can, but >= or <= are probably better choices. Expecting an exact value from an analog sensor is not a good idea.

cekstuffertz

#26
Jan 27, 2013, 11:59 pm Last Edit: Jan 28, 2013, 12:09 am by cekstuffertz Reason: 1
So: if(AnalogRead<40) activate led.
Less is more!

PaulS

Quote
So: if(..........<40) activate led.

Yes, if ..... is the value read from the ping sensor (and 40 is reasonable).

cekstuffertz

Ohh its that easy!

thank you very much and i have now the right code to use!.
Less is more!

Go Up