Often sensors we use give us the option to check if data is ready to be read from. If this is not the case, the ideal action is to check with the sensor again till data is ready rather than consider this a fatal error (like it is considered atm). The easiest solution to this would be to add a checkIfDataReady method for sensors before calling read. However, I will ignore this for now so fundamental sensor code can be written and tested - this fix will have to come after that.
Often sensors we use give us the option to check if data is ready to be read from. If this is not the case, the ideal action is to check with the sensor again till data is ready rather than consider this a fatal error (like it is considered atm). The easiest solution to this would be to add a
checkIfDataReadymethod for sensors before callingread. However, I will ignore this for now so fundamental sensor code can be written and tested - this fix will have to come after that.