#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Continuity Tester for 6-in, 12-out Cable Configuration using Arduino
// Pins for incoming cables
int inPins1 = 2;
int inPins2 = 3;
int inPins3 = 4;
int inPins4 = 5;
int inPins5 = 6;
int inPins6 = 7;
// Pins for outgoing cables (each inPin has two associated outPins)
int outPins1 = 8;
int outPins2 = 9;
int outPins3 = 10;
int outPins4 = 11;
int outPins5 = 12;
int outPins6 = 13;
int outPins7 = A0;
int outPins8 = A1;
int outPins9 = A2;
int outPins10 = A3;
int outPins11 = A4;
int outPins12 = A5;
// Push button pin
const int buttonPin = 1;
LiquidCrystal_I2C lcd(0x27, 20, 4); // I2C address 0x27, 16 columns and 2 rows
void setup() {
// Set up incoming pins as OUTPUT
pinMode(inPins1, OUTPUT);
pinMode(inPins2, OUTPUT);
pinMode(inPins3, OUTPUT);
pinMode(inPins4, OUTPUT);
pinMode(inPins5, OUTPUT);
pinMode(inPins6, OUTPUT);
// Set up outgoing pins as INPUT
pinMode(outPins1, INPUT);
pinMode(outPins2, INPUT);
pinMode(outPins3, INPUT);
pinMode(outPins4, INPUT);
pinMode(outPins5, INPUT);
pinMode(outPins6, INPUT);
pinMode(outPins7, INPUT);
pinMode(outPins8, INPUT);
pinMode(outPins9, INPUT);
pinMode(outPins10, INPUT);
pinMode(outPins11, INPUT);
pinMode(outPins12, INPUT);
// Set up push button pin as INPUT
pinMode(buttonPin, INPUT);
// Initialize LCD
lcd.init();
lcd.backlight();
// Initialize serial communication
Serial.begin(9600);
lcd.setCursor(0, 1);
lcd.print(" Cable Tester v3.");
lcd.setCursor(0, 2);
lcd.print(" Press X to Start");
}
void loop() {
if (digitalRead(buttonPin) == LOW) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Checking");
delay(30); // Delay for stability
lcd.setCursor(8,0);
lcd.print(".");
delay(30); // Delay for stability
lcd.setCursor(9,0);
lcd.print(".");
delay(30); // Delay for stability
lcd.setCursor(10,0);
lcd.print(".");
delay(30); // Delay for stability
lcd.setCursor(11,0);
lcd.print(".");
delay(30); // Delay for stability
lcd.setCursor(12,0);
lcd.print(".");
delay(30); // Delay for stability
lcd.setCursor(13,0);
lcd.print(".");
delay(30); // Delay for stability
lcd.setCursor(14,0);
lcd.print(".");
delay(30); // Delay for stability
lcd.setCursor(15,0);
lcd.print(".");
delay(30); // Delay for stability
lcd.setCursor(16,0);
lcd.print(".");
delay(30); // Delay for stability
lcd.setCursor(17,0);
lcd.print("...");
// Check continuity, opens, and shorts between inPins 2-7 and outPins 8-13
checkConnections(8, 13, "A", "B");
// Check continuity, opens, and shorts between inPins 2-7 and outPins A0-A5
checkConnections(A0, A5, "A", "B");
}
}
void checkConnections(int startPin, int endPin, String group1, String group2) {
String errorMessages1 = ""; // String to accumulate error messages for group 1
String errorMessages2 = ""; // String to accumulate error messages for group 2
String shortMessages1 = ""; // String for shorts in group 1
String shortMessages2 = ""; // String for shorts in group 2
for (int i = 0; i < 6; i++) {
int continuity1A = 0;
int continuity2A = 0;
int continuity1B = 0;
int continuity2B = 0;
int continuity1C = 0;
int continuity2C = 0;
int continuity1D = 0;
int continuity2D = 0;
int continuity1E = 0;
int continuity2E = 0;
int continuity1F = 0;
int continuity2F = 0;
int otherContinuity1 = 0;
int otherContinuity2 = 0;
int otherContinuity3 = 0;
int otherContinuity4 = 0;
int otherContinuity5 = 0;
int otherContinuity6 = 0;
int otherContinuity11 = 0;
int otherContinuity12 = 0;
int otherContinuity13 = 0;
int otherContinuity14 = 0;
int otherContinuity15 = 0;
int otherContinuity16 = 0;
if ( i == 0 ) { //-----------------------------------------------------------------------//
digitalWrite(inPins1, HIGH);
digitalWrite(inPins2, LOW);
digitalWrite(inPins3, LOW);
digitalWrite(inPins4, LOW);
digitalWrite(inPins5, LOW);
digitalWrite(inPins6, LOW);
delay(200);
// Read the voltage on the corresponding pair of outgoing pins
continuity1A = digitalRead(outPins1);
continuity2A = digitalRead(outPins7); // Adjust index to match pins A0-A5
// Check continuity and accumulate error messages
if (continuity1A == LOW) {
errorMessages1 += group1 + String(i + 1) + " ";
}
if (continuity2A == LOW) {
errorMessages2 += group2 + String(i + 1) + " ";
}
}
else if ( i == 1 ){ //-----------------------------------------------------------------------//
digitalWrite(inPins1, LOW);
digitalWrite(inPins2, HIGH);
digitalWrite(inPins3, LOW);
digitalWrite(inPins4, LOW);
digitalWrite(inPins5, LOW);
digitalWrite(inPins6, LOW);
delay(200);
// Read the voltage on the corresponding pair of outgoing pins
continuity1B = digitalRead(outPins2);
continuity2B = digitalRead(outPins8); // Adjust index to match pins A0-A5
// Check continuity and accumulate error messages
if (continuity1B == LOW) {
errorMessages1 += group1 + String(i + 1) + " ";
}
if (continuity2B == LOW) {
errorMessages2 += group2 + String(i + 1) + " ";
}
}
else if ( i == 2 ){ //-----------------------------------------------------------------------//
digitalWrite(inPins1, LOW);
digitalWrite(inPins2, HIGH);
digitalWrite(inPins3, HIGH);
digitalWrite(inPins4, LOW);
digitalWrite(inPins5, LOW);
digitalWrite(inPins6, LOW);
delay(200);
// Read the voltage on the corresponding pair of outgoing pins
continuity1C = digitalRead(outPins3);
continuity2C = digitalRead(outPins9); // Adjust index to match pins A0-A5
// Check continuity and accumulate error messages
if (continuity1C == LOW) {
errorMessages1 += group1 + String(i + 1) + " ";
}
if (continuity2C == LOW) {
errorMessages2 += group2 + String(i + 1) + " ";
}
}
else if ( i == 3 ){ //-----------------------------------------------------------------------//
digitalWrite(inPins1, LOW);
digitalWrite(inPins2, LOW);
digitalWrite(inPins3, LOW);
digitalWrite(inPins4, HIGH);
digitalWrite(inPins5, LOW);
digitalWrite(inPins6, LOW);
delay(200);
// Read the voltage on the corresponding pair of outgoing pins
continuity1D = digitalRead(outPins4);
continuity2D = digitalRead(outPins10); // Adjust index to match pins A0-A5
// Check continuity and accumulate error messages
if (continuity1D == LOW) {
errorMessages1 += group1 + String(i + 1) + " ";
}
if (continuity2D == LOW) {
errorMessages2 += group2 + String(i + 1) + " ";
}
}
else if ( i == 4 ){ //-----------------------------------------------------------------------//
digitalWrite(inPins1, LOW);
digitalWrite(inPins2, LOW);
digitalWrite(inPins3, LOW);
digitalWrite(inPins4, LOW);
digitalWrite(inPins5, HIGH);
digitalWrite(inPins6, LOW);
delay(200);
// Read the voltage on the corresponding pair of outgoing pins
continuity1E = digitalRead(outPins5);
continuity2E = digitalRead(outPins11); // Adjust index to match pins A0-A5
// Check continuity and accumulate error messages
if (continuity1E == LOW) {
errorMessages1 += group1 + String(i + 1) + " ";
}
if (continuity2E == LOW) {
errorMessages2 += group2 + String(i + 1) + " ";
}
}
else if ( i == 5 ){ //-----------------------------------------------------------------------//
digitalWrite(inPins1, LOW);
digitalWrite(inPins2, LOW);
digitalWrite(inPins3, LOW);
digitalWrite(inPins4, LOW);
digitalWrite(inPins5, LOW);
digitalWrite(inPins6, HIGH);
delay(200);
// Read the voltage on the corresponding pair of outgoing pins
continuity1F = digitalRead(outPins6);
continuity2F = digitalRead(outPins12); // Adjust index to match pins A0-A5
// Check continuity and accumulate error messages
if (continuity1F == LOW) {
errorMessages1 += group1 + String(i + 1) + " ";
}
if (continuity2F == LOW) {
errorMessages2 += group2 + String(i + 1) + " ";
}
}
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-=-=-=-=-=-=-=-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Check for shorts with other cables in the same group
otherContinuity1 = digitalRead(outPins1);
otherContinuity2 = digitalRead(outPins2);
otherContinuity3 = digitalRead(outPins3);
otherContinuity4 = digitalRead(outPins4);
otherContinuity5 = digitalRead(outPins5);
otherContinuity6 = digitalRead(outPins6);
otherContinuity11 = digitalRead(outPins7);
otherContinuity12 = digitalRead(outPins8);
otherContinuity13 = digitalRead(outPins9);
otherContinuity14 = digitalRead(outPins10);
otherContinuity15 = digitalRead(outPins11);
otherContinuity16 = digitalRead(outPins12);
if (i == 0) {
//if (continuity1 == HIGH && otherContinuity1 == HIGH) {
// shortMessages1 += group1 + String(i + 1) + "-" + String(8) + " ";
//}
if (continuity1A == HIGH && otherContinuity2 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(2) + " ";
}
else if (continuity1A == HIGH && otherContinuity3 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(3) + " ";
}
else if (continuity1A == HIGH && otherContinuity4 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(4) + " ";
}
else if (continuity1A == HIGH && otherContinuity5 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(5) + " ";
}
else if (continuity1A == HIGH && otherContinuity6 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(6) + " ";
}
else {
//if (continuity2 == HIGH && otherContinuity1 == HIGH) {
// shortMessages2 += group2 + String(i + 1) + "-" + String(A0) + " ";
//}
if (continuity2A == HIGH && otherContinuity12 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(2) + " ";
}
else if (continuity2A == HIGH && otherContinuity13 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(3) + " ";
}
else if (continuity2A == HIGH && otherContinuity14 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(4) + " ";
}
else if (continuity2A == HIGH && otherContinuity15 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(5) + " ";
}
else if (continuity2A == HIGH && otherContinuity16 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(6) + " ";
}
}
// Reset the current incoming pin to LOW
digitalWrite(inPins1, LOW);
digitalWrite(inPins2, LOW);
digitalWrite(inPins3, LOW);
digitalWrite(inPins4, LOW);
digitalWrite(inPins5, LOW);
digitalWrite(inPins6, LOW);
otherContinuity1 = 0;
otherContinuity2 = 0;
otherContinuity3 = 0;
otherContinuity4 = 0;
otherContinuity5 = 0;
otherContinuity6 = 0;
otherContinuity11 = 0;
otherContinuity12 = 0;
otherContinuity13 = 0;
otherContinuity14 = 0;
otherContinuity15 = 0;
otherContinuity16 = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (i == 1) {
if (continuity1B == HIGH && otherContinuity1 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(1) + " ";
}
//if (continuity1 == HIGH && otherContinuity2 == HIGH) {
// shortMessages1 += group1 + String(i + 1) + "-" + String(9) + " ";
//}
else if (continuity1B == HIGH && otherContinuity3 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(3) + " ";
}
else if (continuity1B == HIGH && otherContinuity4 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(4) + " ";
}
else if (continuity1B == HIGH && otherContinuity5 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(5) + " ";
}
else if (continuity1B == HIGH && otherContinuity6 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(6) + " ";
}
else {
if (continuity2B == HIGH && otherContinuity11 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(1) + " ";
}
//if (continuity2 == HIGH && otherContinuity2 == HIGH) {
// shortMessages2 += group2 + String(i + 1) + "-" + String(A1) + " ";
//}
else if (continuity2B == HIGH && otherContinuity13 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(3) + " ";
}
else if (continuity2B == HIGH && otherContinuity14 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(4) + " ";
}
else if (continuity2B == HIGH && otherContinuity15 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(5) + " ";
}
else if (continuity2B == HIGH && otherContinuity16 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(6) + " ";
}
}
// Reset the current incoming pin to LOW
digitalWrite(inPins1, LOW);
digitalWrite(inPins2, LOW);
digitalWrite(inPins3, LOW);
digitalWrite(inPins4, LOW);
digitalWrite(inPins5, LOW);
digitalWrite(inPins6, LOW);
otherContinuity1 = 0;
otherContinuity2 = 0;
otherContinuity3 = 0;
otherContinuity4 = 0;
otherContinuity5 = 0;
otherContinuity6 = 0;
otherContinuity11 = 0;
otherContinuity12 = 0;
otherContinuity13 = 0;
otherContinuity14 = 0;
otherContinuity15 = 0;
otherContinuity16 = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (i == 2) {
if (continuity1C == HIGH && otherContinuity1 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(1) + " ";
}
else if (continuity1C == HIGH && otherContinuity2 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(2) + " ";
}
//if (continuity1 == HIGH && otherContinuity3 == HIGH) {
// shortMessages1 += group1 + String(i + 1) + "-" + String(10) + " ";
//}
else if (continuity1C == HIGH && otherContinuity4 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(4) + " ";
}
else if (continuity1C == HIGH && otherContinuity5 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(5) + " ";
}
else if (continuity1C == HIGH && otherContinuity6 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(6) + " ";
}
else {
if (continuity2C == HIGH && otherContinuity11 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(1) + " ";
}
else if (continuity2C == HIGH && otherContinuity12 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(2) + " ";
}
//if (continuity2 == HIGH && otherContinuity3 == HIGH) {
// shortMessages2 += group2 + String(i + 1) + "-" + String(A2) + " ";
//}
else if (continuity2C == HIGH && otherContinuity14 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(4) + " ";
}
else if (continuity2C == HIGH && otherContinuity15 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(5) + " ";
}
else if (continuity2C == HIGH && otherContinuity16 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(6) + " ";
}
}
// Reset the current incoming pin to LOW
digitalWrite(inPins1, LOW);
digitalWrite(inPins2, LOW);
digitalWrite(inPins3, LOW);
digitalWrite(inPins4, LOW);
digitalWrite(inPins5, LOW);
digitalWrite(inPins6, LOW);
otherContinuity1 = 0;
otherContinuity2 = 0;
otherContinuity3 = 0;
otherContinuity4 = 0;
otherContinuity5 = 0;
otherContinuity6 = 0;
otherContinuity11 = 0;
otherContinuity12 = 0;
otherContinuity13 = 0;
otherContinuity14 = 0;
otherContinuity15 = 0;
otherContinuity16 = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (i == 3) {
if (continuity1D == HIGH && otherContinuity1 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(1) + " ";
}
else if (continuity1D == HIGH && otherContinuity2 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(2) + " ";
}
else if (continuity1D == HIGH && otherContinuity3 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(3) + " ";
}
//if (continuity1 == HIGH && otherContinuity4 == HIGH) {
// shortMessages1 += group1 + String(i + 1) + "-" + String(11) + " ";
//}
else if (continuity1D == HIGH && otherContinuity5 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(5) + " ";
}
else if (continuity1D == HIGH && otherContinuity6 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(6) + " ";
}
else {
if (continuity2D == HIGH && otherContinuity11 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(1) + " ";
}
else if (continuity2D == HIGH && otherContinuity12 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(2) + " ";
}
else if (continuity2D == HIGH && otherContinuity13 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(3) + " ";
}
//if (continuity2 == HIGH && otherContinuity4 == HIGH) {
// shortMessages2 += group2 + String(i + 1) + "-" + String(A3) + " ";
//}
else if (continuity2D == HIGH && otherContinuity15 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(5) + " ";
}
else if (continuity2D == HIGH && otherContinuity16 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(6) + " ";
}
}
// Reset the current incoming pin to LOW
digitalWrite(inPins1, LOW);
digitalWrite(inPins2, LOW);
digitalWrite(inPins3, LOW);
digitalWrite(inPins4, LOW);
digitalWrite(inPins5, LOW);
digitalWrite(inPins6, LOW);
otherContinuity1 = 0;
otherContinuity2 = 0;
otherContinuity3 = 0;
otherContinuity4 = 0;
otherContinuity5 = 0;
otherContinuity6 = 0;
otherContinuity11 = 0;
otherContinuity12 = 0;
otherContinuity13 = 0;
otherContinuity14 = 0;
otherContinuity15 = 0;
otherContinuity16 = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (i == 4) {
if (continuity1E == HIGH && otherContinuity1 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(1) + " ";
}
else if (continuity1E == HIGH && otherContinuity2 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(2) + " ";
}
else if (continuity1E == HIGH && otherContinuity3 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(3) + " ";
}
else if (continuity1E == HIGH && otherContinuity4 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(4) + " ";
}
//if (continuity1 == HIGH && otherContinuity5 == HIGH) {
// shortMessages1 += group1 + String(i + 1) + "-" + String(12) + " ";
//}
else if (continuity1E == HIGH && otherContinuity6 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(6) + " ";
}
else {
if (continuity2E == HIGH && otherContinuity11 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(1) + " ";
}
else if (continuity2E == HIGH && otherContinuity12 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(2) + " ";
}
else if (continuity2E == HIGH && otherContinuity13 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(3) + " ";
}
else if (continuity2E == HIGH && otherContinuity14 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(4) + " ";
}
//if (continuity2 == HIGH && otherContinuity5 == HIGH) {
// shortMessages2 += group2 + String(i + 1) + "-" + String(A4) + " ";
//}
else if (continuity2E == HIGH && otherContinuity16 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(6) + " ";
}
}
// Reset the current incoming pin to LOW
digitalWrite(inPins1, LOW);
digitalWrite(inPins2, LOW);
digitalWrite(inPins3, LOW);
digitalWrite(inPins4, LOW);
digitalWrite(inPins5, LOW);
digitalWrite(inPins6, LOW);
otherContinuity1 = 0;
otherContinuity2 = 0;
otherContinuity3 = 0;
otherContinuity4 = 0;
otherContinuity5 = 0;
otherContinuity6 = 0;
otherContinuity11 = 0;
otherContinuity12 = 0;
otherContinuity13 = 0;
otherContinuity14 = 0;
otherContinuity15 = 0;
otherContinuity16 = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (i == 5) {
if (continuity1F == HIGH && otherContinuity1 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(1) + " ";
}
else if (continuity1F == HIGH && otherContinuity2 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(2) + " ";
}
else if (continuity1F == HIGH && otherContinuity3 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(3) + " ";
}
else if (continuity1F == HIGH && otherContinuity4 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(4) + " ";
}
else if (continuity1F == HIGH && otherContinuity5 == HIGH) {
shortMessages1 += group1 + String(i + 1) + "-" + String(5) + " ";
}
//if (continuity1 == HIGH && otherContinuity6 == HIGH) {
// shortMessages1 += group1 + String(i + 1) + "-" + String(13) + " ";
//}
else{
if (continuity2F == HIGH && otherContinuity11 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(1) + " ";
}
else if (continuity2F == HIGH && otherContinuity12 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(2) + " ";
}
else if (continuity2F == HIGH && otherContinuity13 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(3) + " ";
}
else if (continuity2F == HIGH && otherContinuity14 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(4) + " ";
}
else if (continuity2F == HIGH && otherContinuity15 == HIGH) {
shortMessages2 += group2 + String(i + 1) + "-" + String(5) + " ";
}
//if (continuity2 == HIGH && otherContinuity6 == HIGH) {
// shortMessages2 += group2 + String(i + 1) + "-" + String(A5) + " ";
//}
}
// Reset the current incoming pin to LOW
digitalWrite(inPins1, LOW);
digitalWrite(inPins2, LOW);
digitalWrite(inPins3, LOW);
digitalWrite(inPins4, LOW);
digitalWrite(inPins5, LOW);
digitalWrite(inPins6, LOW);
otherContinuity1 = 0;
otherContinuity2 = 0;
otherContinuity3 = 0;
otherContinuity4 = 0;
otherContinuity5 = 0;
otherContinuity6 = 0;
otherContinuity11 = 0;
otherContinuity12 = 0;
otherContinuity13 = 0;
otherContinuity14 = 0;
otherContinuity15 = 0;
otherContinuity16 = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
// Adjust the delay based on your requirements
delay(200);
// Display accumulated error messages and short messages on the LCD
displayLCDResults(errorMessages1, errorMessages2, shortMessages1, shortMessages2);
}
// Function to display results on LCD
void displayLCDResults(String errorMessages1, String errorMessages2, String shortMessages1, String shortMessages2) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("NG:");
lcd.print(errorMessages1);
lcd.setCursor(0, 1);
lcd.print("NG:");
lcd.print(errorMessages2);
lcd.setCursor(0, 2);
lcd.print("S:" + shortMessages1);
lcd.setCursor(0, 3);
lcd.print("S:" + shortMessages2);
delay(1000); // Display for 3 seconds
}