So I have two LED displays (10 digital pins) that will be 20 ft away each from the Arduino. A 20 ft wire hooking up the display apparently does not work out so well (learned that the hard way). So I think the next best thing would be to have a main arduino for the other things (keypad, sensors), and have other arduinos hooked up to each display.
I've worked with Xbee's before, so that's an option, but I really want to go cheap. What is the best (and most frugal) way to connect these up to 20 feet away?
So take the main arduino, hook up RX to pin1, TX to pin0, gnd to gnd, send a 20ft male-male cable up to the display arduino which also has a rs232 board with the same hookup? Then anything sent over the serial should be picked up by the display arduino?
Simple test code for sending serial data from one arduino to another arduino using wires between the two.
//zoomkat 3-5-12 simple delimited ',' string tx/rx
//from serial port input (via serial monitor)
//and print result out serial port
//Connect the sending arduino rx pin to the receiving arduino rx pin.
//Connect the arduino grounds together.
//What is sent to the tx arduino is received on the rx arduino.
//Open serial monitor on both arduinos to test
String readString;
void setup() {
Serial.begin(9600);
Serial.println("serial delimit test 1.0"); // so I can keep track of what is loaded
}
void loop() {
//expect a string like wer,qwe rty,123 456,hyre kjhg,
//or like hello world,who are you?,bye!,
if (Serial.available()) {
char c = Serial.read(); //gets one byte from serial buffer
if (c == ',') {
if (readString.length() >1) {
Serial.print(readString); //prints string to serial port out
Serial.println(','); //prints delimiting ","
//do stuff with the captured readString
readString=""; //clears variable for new input
}
}
else {
readString += c; //makes the string readString
}
}
}