Hopefully someone can point out what I'm missing here. I just transitioned a class into its own library (which was a bit of a learning experience for me), and now I'm getting this error
warning: comparison between signed and unsigned integer expressions
from this function in the library .cpp. I've indicated which line the warning is indicated on, and I can't for the life of my understand why that would cause this warning:
void DebouncedInput::refresh() {
status = digitalRead(pin);
if( status != lastStatus && millis() - lastChangeTime > debounceDelay ) {
changed=true; /*warning indicated on this line*/
pressed = inverted ? !status : status;
released = !pressed;
lastStatus = status;
prevChangeTime = lastChangeTime;
lastChangeTime = millis();
}
else {
changed=false;
lastReadTime=millis();
}
}
Here's the library .h file in its entirety:
#ifndef SmartInput_h
#define SmartInput_h
class DebouncedInput {
public:
DebouncedInput( int inPin, int dbTime);
DebouncedInput (int inPin, int dbTime, boolean inv );
void refresh(); // Read current status
long sinceLast(); //time since last status change
long lastInterval();
void pullup(boolean pullup);
int pin;
boolean status;
boolean inverted; //True if a HIGH==released && LOW==pressed at the input, False otherwise.
long lastReadTime; //time of latest read
long lastChangeTime; //time of most recent change
long prevChangeTime;//time of previous change
long debounceDelay;
boolean lastStatus; //status in last iteration
boolean pressed;
boolean released;
boolean changed;
};
#endif
Thanks in advance.