Go Down

Topic: Simple math question? (Read 485 times) previous topic - next topic


Mar 08, 2009, 02:33 am Last Edit: Mar 08, 2009, 02:59 am by kennyj Reason: 1
How do I find the largest of 3 numbers?

int dist1 = 8;
int dist2 = 5;
int dist3 = 10;


Code: [Select]

int maxValue = max(dist1,max(dist2,dist3));

See here: http://arduino.cc/en/Reference/Max

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131