outout state, tritium sensor, and vaccum output to serial port

This commit is contained in:
Ryan Tang 2023-11-09 14:52:08 -05:00
parent bada3c34ee
commit 9f3e8fe000
2 changed files with 36 additions and 1 deletions

7
README.md Normal file
View File

@ -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.

View File

@ -29,6 +29,10 @@ unsigned long lcdReset = 0;
int lcdLooper = 0; int lcdLooper = 0;
int lcdLine2 = 16; 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 *Setup function runs once on startup
*******/ *******/
@ -106,4 +110,28 @@ void loop() {
// Reset the watchdog timer // Reset the watchdog timer
P1.petWD(); 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
}
} }