added debugging output to measure function()
still unsure what's going wrong. it very well be with the sensor itself and not the code