How To Control 2 ARDUINO Boards At The Same Time With MIT App Inventor

This tutorial will show you how to connect to and control two arduino boards at the same time with MIT App inventor 2.

click on video below for full tutorial….

 

MIT App Inventor Blocks:

 

ARDUINO sketch:

int led=8;
int x = 1;
void setup() {
pinMode(led, OUTPUT);
Serial.begin(9600);
}

void loop() {

if (Serial.available() >= 2 )
{
unsigned int a = Serial.read();
unsigned int b = Serial.read();
unsigned int val = (b * 256) + a;
if (val == 1000 && x == 1)
{
digitalWrite(led, HIGH);
x = 2;
}
else if (val == 1000 && x == 2)
{
digitalWrite(led, LOW);
x = 1;
}
}
}

Check us out on Facebook…..       https://www.facebook.com/zarduino/

Advertisements