I'm making up a large number of 6 conductor IDC cables with an IDC connector both ends, and finding it easy for these to have a fault - hence the tester.
A simple breadboard with 6 resistors and LED's. +5V (HIGH) side of LED's connected to pins 2 - 7, other side of LED's connected to IDC header. Other IDC header connected to pins 8 - 13.
My logic says that if 2 LEDs are lit on the first part, then the fault must be on the LOW side (pins 8 - 13), so cut that connector off & redo it!
Similarly if 2 LEds lit on second part, then the connector connected to the LEDs and then on to pins 2 -7 is the one at fault.
Everything working great UNTIL I have this one cable that even if I reverse the cable, the 2 LEDs light on part 2 every time. It's not a connection failure as another cable works perfectly
So having spent a lot of time pulling hair in frustration, thinking the theory sound, maybe it's the code - but that looks OK to me as well
So if anyone can point out the stupid mistake I have made, it would be hugely appreciated
#include <Streaming.h>
void setup() {
Serial.begin(115200);
while (!Serial) {} //wait for it to open
Serial.println("setup complete!");
for (int c = 2; c <=13; c++ ) {
pinMode(c, OUTPUT);
}
}
void loop() {
//do the seperate HIGH first
for (int c = 2; c <= 13; c++) {
digitalWrite(c, LOW);
}
delay(100);
for (int c = 2; c <= 7; c++) {
Serial << "HIGH C: " << c << endl;
digitalWrite(c, HIGH);
delay(500);
digitalWrite(c, LOW);
}
delay(500);
//now the seperate LOW
for (int c = 2; c <= 13; c++) {
digitalWrite(c, HIGH);
}
delay(100);
for (int c = 8; c <= 13; c++) {
Serial << "LOW C: " << c << endl;
digitalWrite(c, LOW);
delay(500);
digitalWrite(c, HIGH);
}
//show where we are in sequence - can't tell end when 1 bank not working
//High flash
Serial << "All LOW, flash set HIGH " << endl;
for (int c = 2; c <= 13; c++) {
digitalWrite(c, LOW);
}
delay(100);
for (int c = 2; c <= 7; c++) {
digitalWrite(c, HIGH);
}
delay(500);
//LOW flash
Serial << "All HIGH, flash set LOW" << endl;
for (int c = 2; c <= 13; c++) {
digitalWrite(c, HIGH);
}
delay(100);
for (int c = 8; c <= 13; c++) {
digitalWrite(c, LOW);
}
delay(500);
}