86Views5Replies

Author Options:

how would I get my arduino to respond to a certain amout of numbers? Answered

I need it to do something only when an input from a sensor gives an input such as 300, all the way up to 400

Discussions

0
None
steveastrouk

Best Answer 9 years ago

Use an "If" statement ? 


0
None
wii552steveastrouk

Answer 9 years ago

how to respond to a range of numbers. I thought of if

0
None
steveastroukwii552

Answer 9 years ago

If (input>300) && (input <400)
{
//do something
}

0
None
Jayefuusteveastrouk

Answer 9 years ago

wii552 it sounds like it would be beneficial for you to read through the "Control Structures" section of the arduino website, it explains what Steve's suggested, with some more helpful examples.

http://arduino.cc/en/Tutorial/HomePage

0
None
wii552Jayefuu

Answer 9 years ago

don't worry, I got it