yes the warning makes sense for the macro given that a byte type is unsigned so is never negative. if the macro had been written with <= instead of < then 0 would have been an acceptable value and the warning would not be there
</sub> <sub> #define myConstrain(amt,low,high) ((amt)[color=red] <= [/color] (low) ? (low) : ((amt)>(high)?(high):(amt)))</sub> <sub>
this does not give any warning
#define myConstrain(amt,low,high) ((amt)<=(low)?(low):((amt)>(high)?(high):(amt)))
byte a = 20;
void setup() {
Serial.begin(115200);
a = myConstrain(a, 0, 250);
Serial.print("\n\na: ");
Serial.print(a);
}
void loop() {}