Updating sensor reading to a polling-based state machine to save memory and work with different ADC v-ref sources