This may be a odd or really stupid question... but i am having trouble comparing the current reading from a sensor to the previous previous reading....
500 --> comparing this
300
200 --> to this
I am able to compare the previous values but am confused about the prepre value ![]()
i tried this:
void detectGreen()
{
ppColor = preColor;
color = analogRead(4);
if(color < ppColor - 50);
 Stop();
preColor = color;
delay(60);
but it works the same as comparing the previous value to the current value...
So i was hoping someone could help me out with the obviously wrong logic it would be much appreciated!
Thank you!