I need to control a device that is basically a video matrix its got 4 inputs a...d and 4 outputs 1..4, it wants to see ascii commands in the form of inputoutput so C2 would send input C to output 2, then the device makes the switch and sends back a string "input A to output 2". I made a very rudementary program that polls the digital pins which have buttons that provide a closure and makes the switch accordingly, the program worked fine for a couple of days, then it stopped working, the rs232 shield from cutedigi stopped working, the tx led in it lites up very dimly, it use to be bright when it was working, i tried doing the sample pc-pc program and it still doesnt work the board burned up, I was hoping someone can look throught this very simple code and tell me if something I am doing or not doing caused the board to burn up, something like ignoring the feed back
void setup() {
//Initialize serial and wait for port to open:
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
Serial.begin(4800);
}
void loop() {
int command1 = digitalRead(2);
int command2 = digitalRead(3);
int command3 = digitalRead(4);
int command4 = digitalRead(5);
int command5 = digitalRead(6);
int command6 = digitalRead(7);
int command7 = digitalRead(8);
int command8 = digitalRead(9);
if (command1 != HIGH) {
Serial.println("A1");
delay(500);
}
if (command2 != HIGH) {
Serial.println("A2");
delay(500);
}
if (command3 != HIGH) {
Serial.println("A3");
delay(500);
}
if (command4 != HIGH) {
Serial.println("A4");
delay(500);
}
if (command5 != HIGH) {
Serial.println("B1");
delay(500);
}
if (command6 != HIGH) {
Serial.println("B2");
delay(500);
}
if (command7 != HIGH) {
Serial.println("B3");
delay(500);
}
if (command8 != HIGH) {
Serial.println("B4");
delay(500);
}
}