Hi DeBende
Couple of points on the following:
uint8_t input=0;
uint8_t lastRead=90;
...
void readSens(){
if (millis()>lastRead+50){
input = analogRead(analogIn);
if (input>maxInput){
maxInput=input;
}
input=map(input,0,maxInput,10,255);
// Serial.println(input);
}
}
analogRead() returns a value from 0 to 1023, so not sure what will happen when you assign it to input declared as uint8_t.
EDIT: it will calculate the remainder of the analogRead() value when divided by 256. I.e. as per the modulus (%) operator.
lastRead is also declared as uint8_t, whereas millis() returns uint32_t. Also I can't see where lastRead is updated, so the comparison with millis() is (almost) always going to be true, I think.
Regards
Ray