I have a gas sensor that measures the carbon dioxide concentration in the atmosphere. The sensor outputs the reading to the serial monitor by means of serial communication. By default, it collects 20 data per second, but I only want it to show 1 data per second. I’ve incorporated the code from the example ‘Blink Without Delay’, but encountered a problem. On my serial monitor, sometimes two consecutive data strings are concatenated together (refer to attached photo and Arduino code). How do I fix this?
sketch_feb02a.ino (2.32 KB)