Hello,
I am using now days to figure out a simple way to count the time on an event. The event is starting and stopping. Will say every time the event is active count the time as long as it is active add it to the saved time and stop counting when the event is inactive. Writing every 5 minutes to save the EEPROM is enough.
I am using the Teensy 3.5 with onboard RTC.
This function is part of on Engine Gateway translating analog signals and engine states to a CAN bus like system.
WHat I tried until now was to set the start time using millis and the stop time using millis. subtract them to get the current running time. The event gets triggered as soon as the engine RPM is equal or above 200 RPM.
I think it is also no problem for me to get the time saved and read at startup from the flash device (eeprom or fram)
Is there a function of RTC which shows seconds elapsed since 1970? I thought I have read something like this somewhere, but I can“t find something similar in the docs.
Since the state of the engine can change several times while the teensy is powered up I run into problems. My programming knowledge is not yet very good, unfortunately.
Can you help me to get this function which starts when the event is given (RPM >= 200) and stopping counting as soon the engine is stopped (RPM<=200)?
The RPM counter I based on FreqMeasureMulti and working fine so far.
I thought to use simple if else to read the state of the engine. So the time counting function is missing.
There are a lot of running engine hour meters on the web, but all do not fit somehow or I do not understand them..