//Defines to shorten print statements
#define sp(x) Serial.print(x)
#define spl(x) Serial.println(x)
#undef constrain()
long constrain(long val, long min, long max) {
if (val <= min) return min;
if (val >= max) return max;
return val;
}
//This saves dynamic memory by assigning constant strings to Program memory
#define mp(x) Serial.print(F(x))
#define mpl(x) Serial.println(F(x))
char bf[50] = "test";
#define qp(...) sprintf(bf, __VA_ARGS__ ); Serial.println(bf)
//This saves dynamic memory by assigning constant strings to Program memory
#define disp(line,msg) display(line,F(msg))
void setup () {
Serial.begin(115200);
// put your setup code here, to run once:
int x = 890L, y = -890;
x = constrain(x, 0L, 255L);
qp("Concheck %d", constrain(random(-90, 90), 0, 10));
for (int i = 0; i < 10; i++) {
qp("Concheck %d", constrain(random(-90, 90), 0, 10));
}
qp("Long %d", constrain(99999L, 0L, 10L));
Serial.println(constrain(100.5, 1, 10.6)) ;
}
void loop() {
// put your main code here, to run repeatedly:
}