Go Down

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

kennyj

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;

etracer

Code: [Select]

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


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

Go Up