hold last sensor value

You need a Serial.begin(115200); in setup() and some Serial.print() statements in loop. What value are you reading from the sensor each time? It is possible that you are not getting the clean 0 that you think you are.

What value is ending up in note?