Pages: [1]   Go Down
Author Topic: inbetween statement?  (Read 453 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
God Member
*****
Karma: 0
Posts: 507
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi smiley

i want to use a joystick to control 4 leds ( or 5 ) but i want one of my statements to be an "in between" statement, like for example:

"if that number is in between 500 and 550, then do this!"  is there such a statement?
thnks
-big93
Logged

0
Offline Offline
Faraday Member
**
Karma: 7
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
if (x >= 500 && x <= 550)
{
  dosomething();
}

-j

Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 507
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you for the quick reply smiley
« Last Edit: December 16, 2007, 03:44:46 pm by big93 » Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 507
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

YES!

succesfull code!

thanks a bunch
Logged

Pages: [1]   Go Up
Jump to: