Pages: [1]   Go Down
Author Topic: Serial Connection between two Arduino's  (Read 335 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I have a little issue, I have two arduino's connected together:
Arduino 1:
TX connected to Arduino 2's RX
RX connected to Arduino 2's TX

Code of arduino 1
Code:
void setup()
{
  Serial.begin(9600);
  pinMode(13, OUTPUT);
}

void loop()
{
  if(Serial.available() > 0)
  {
    Serial.read();
    digitalWrite(13, HIGH);
    delay(100);
    digitalWrite(13, LOW);
  }
}

Arduino 2's code
Code:
void setup()
{
  Serial.begin(9600);
  delay(200);
  Serial.print("i");
}

void loop()
{

}

What it should do is, when I press arduino 2's reset button, the LED on arduino 1 should turn on and off for a little while. But it does not work, does anyone know why?

Thanks in advance!
ikkentim
Logged

California
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3447
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you connect the grounds together?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, is it required?  smiley-confuse
Logged

California
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3447
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, is it required?  smiley-confuse

Yes...
Logged

Pages: [1]   Go Up
Jump to: