Giovanni Gentile
Published © GPL3+

Communication Between Arduino UNO

If you want use two Arduino, you can use a simple I/O port to communicate. The point of question is the Ground.

BeginnerProtip30 minutes19,774
Communication Between Arduino UNO

Things used in this project

Story

Read more

Schematics

Arduino to Arduino I/O connection

Code

Arduino UNO A

Arduino
#define LED 13
#define IN A0
int val = 0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(IN, INPUT);
  pinMode(LED, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  val = analogRead(IN);
  Serial.println(val);
  if (val >= 740) {
    digitalWrite(LED, HIGH);
    Serial.println("HIGH");
  }
  else {
    digitalWrite(LED, LOW);
  }
  //delay(50);
}

Arduino UNO B

Arduino
#define SMS 6
#define LED 13

void setup() {
pinMode(SMS, OUTPUT);
pinMode (LED, OUTPUT);
}

void loop() {
digitalWrite(SMS, HIGH);
digitalWrite(LED,HIGH);
delay(2000);
digitalWrite(SMS, LOW);
digitalWrite(LED, LOW);
delay(200);
}

Credits

Giovanni Gentile
36 projects • 98 followers
Graduated in Psychology Artificial Intelligence department. Expert in electronics, automation and IoT. Now working on VR-AR experiences.

Comments