From 9f3e8fe00005fdef51c90a4e14a2064da39a067a Mon Sep 17 00:00:00 2001 From: "Ryan@pi02" Date: Thu, 9 Nov 2023 14:52:08 -0500 Subject: [PATCH] outout state, tritium sensor, and vaccum output to serial port --- README.md | 7 +++++++ interlock/interlock.ino | 30 +++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e8a9f0d --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# introduction + +The interlock folder contains P1AM-100 code (which is Arduino MKX1000). + +## setup using Arduino IDE 1.X + +The P1AM.h library is needed. diff --git a/interlock/interlock.ino b/interlock/interlock.ino index b0718a1..12eecce 100644 --- a/interlock/interlock.ino +++ b/interlock/interlock.ino @@ -29,6 +29,10 @@ unsigned long lcdReset = 0; int lcdLooper = 0; int lcdLine2 = 16; +// Timer for Serial output +unsigned long previousMillis = 0; +const unsigned long interval = 5000; // 1000 milliseconds = 1 second + /******* *Setup function runs once on startup *******/ @@ -105,5 +109,29 @@ void loop() { // Reset the watchdog timer P1.petWD(); - + + unsigned long currentMillis = millis(); + + if (currentMillis - previousMillis >= interval) { + //Serial.print("server is at "); + //Serial.println(Ethernet.localIP()); + + Serial.print("State: "); + Serial.print(currentState); + Serial.print(". "); + + Serial.print("Tritium sensor: "); + Serial.print(tSniffer); + Serial.print(" mCr. "); + + Serial.print("Vaccum: "); + Serial.print(vacuum); + Serial.print(" Torr. "); + + Serial.print("SubPump: "); + Serial.print(subPump); + Serial.println(" amp."); + + previousMillis = currentMillis; // Reset the timer + } }