int myValue = 1200;
int myValue2 = 2000;
int out;
int maxOutput;
void setup() {
Serial.begin(9600);
Serial.println("BEGIN");
Serial.println();
}
void loop() {
/*
//**************** max by max function ****************
out = max(myValue, 290);
maxOutput = max(out, myValue2);
Serial.println(maxOutput);
delay(2000);
//*****************************************************
*/
//**************** min by min function ****************
out = min(myValue, myValue2);
Serial.println(out);
//*****************************************************
/*
//**************** max by if statements ***************
if (myValue > myValue2) {
out = myValue;
}
else {out = myValue2;
}
if (out > 500) {
maxOutput = out;
}
else {maxOutput = 500;
}
Serial.println(maxOutput);
delay(2000);
//***************************************************
*/
}