Very rough arduino pseudocode for reading sensor data