endsWith Not working for me.

 if (sensorReading.endsWith(0)) {

Perhaps you meant:

 if (sensorReading.endsWith("0")) {

or maybe

 if (sensorReading.endsWith('0')) {