Another thing that is missing from the code is setting flow rates to zero, if an input loses the signal for some reason. As it is now, the value stays whatever the last measured value was. This means that is an input signal is lost, it will continually log the last measured value. Any ideas on how to do this?
You need to use timeouts so that when an input stops responding (rising), the timeout condition will clear the appropriate pulsePeriod, pulseFrequency and flowRate.
Had a bit of time before I go ... added independent timeout for each channel (untested).
? See attachment ?
Fuel_Flow_Logging_to_SD_Card_4_channels_UNO_WORKING.ino (9.1 KB)