Guten morgen zusammen,
ich habe eine kleines Projekt und möchte dafür die zeit zwischen 2 Events auslesen, was ja eigentlich eine einfache Kiste sein sollte.
Alle 5 sek. werden shiftregister ausgelesen, sollte einer offen sein wird der timer gestartet. Ist der Sensor länger als 10sec. offen soll das relay 1 geschalten werden und länger als 180sec. dann wird ein weiteres Relay geschalten.
Leider gibt es bei meinem Script das Problem dass bereits nachdem der timer das erste mal ausgelesen wird angeblich bereits 16843s vergangen sind und 5 sec später beim nächsten readout bereits 4294967s (entspricht 4294967276 = 2^32 was wohl der max. für millis() ist)
Hab ich irgendetwas vergessen zu deklarieren oder etwas vergessen anzuschliessen oder warum zähl mein Board zu schnell.
Ich benutzte entweder ein Arduino Nano oder ein Pro Mini und bei beiden habe ich das Verhalten beobachtet.
Unten angehangen habe eich einmal mein Seriell Read out und auch das Program. Für Tipps wäre ich verdammt dankbar
Lieben Gruss
Stefan
Starting reading out of ShiftRegister - (round #1)
Checking Sensors
Connected Sensors: 0
Closed Sensors: 11111111
Sensor: 1 is connected and closed.
Sensor: 2 is connected and closed.
Sensor: 3 is connected and closed.
Sensor: 4 is connected and closed.
Sensor: 5 is connected and closed.
Sensor: 6 is connected and closed.
Sensor: 7 is connected and closed.
Sensor: 8 is connected and closed.
All Sensors closed.
---------Finished ----------
Starting reading out of ShiftRegister - (round #2)
Checking Sensors
Connected Sensors: 0
Closed Sensors: 1111111
Sensor: 1 is connected and closed.
Sensor: 2 is connected and closed.
Sensor: 3 is connected and closed.
Sensor: 4 is connected and closed.
Sensor: 5 is connected and closed.
Sensor: 6 is connected and closed.
Sensor: 7 is connected and closed.
Sensor: 8 is connected but open.
Sensor opened - Starting timer
Start: 16843
---------Finished ----------
Starting reading out of ShiftRegister - (round #3)
Checking Sensors
Connected Sensors: 0
Closed Sensors: 1111111
Sensor: 1 is connected and closed.
Sensor: 2 is connected and closed.
Sensor: 3 is connected and closed.
Sensor: 4 is connected and closed.
Sensor: 5 is connected and closed.
Sensor: 6 is connected and closed.
Sensor: 7 is connected and closed.
Sensor: 8 is connected but open.
Timer too high for Relay #0 | elapsed time = 4294967 max allowed time = 10000
Timer too high for Relay #1 | elapsed time = 4294967 max allowed time = 180000
---------Finished ----------
Starting reading out of ShiftRegister - (round #4)
Checking Sensors
Connected Sensors: 0
Closed Sensors: 11111111
Sensor: 1 is connected and closed.
Sensor: 2 is connected and closed.
Sensor: 3 is connected and closed.
Sensor: 4 is connected and closed.
Sensor: 5 is connected and closed.
Sensor: 6 is connected and closed.
Sensor: 7 is connected and closed.
Sensor: 8 is connected and closed.
All Sensors closed.
FreezerLogger.ino (6.94 KB)