/* simple cable tester with teensy 2.0 Turns on an 8 LEDs on for one second. www.weigu.lu/cable_tester This example code is in the public domain. */ const byte TeensyLED = 11; const byte LED1 = 21; const byte LED2 = 20; const byte LED3 = 19; const byte LED4 = 18; const byte LED5 = 17; const byte LED6 = 16; const byte LED7 = 15; const byte LED8 = 14; const byte LEDs[8] = {LED1,LED2,LED3,LED4,LED5,LED6,LED7,LED8}; void SetLED(byte pin, int ms) { digitalWrite(pin, HIGH); delay(ms); digitalWrite(pin, LOW);} void setup() { pinMode(TeensyLED, OUTPUT); for (byte i = 0;i < 8;i++) { pinMode(LEDs[i], OUTPUT);}} void loop() { for (byte i = 0;i < 8;i++) { digitalWrite(TeensyLED, HIGH); SetLED(LEDs[i],1000); digitalWrite(TeensyLED, LOW); delay(500);}}