APC220 communication between 2 boards

Could be found on the wiki .
Tips:
how to avoid to Run as Administrator every time
Use the setting below to both APC220
2 Upload sketch to each board
My test was on Uno & Leonardo( Serial1)
Uno as receiver:
Code: Select all//uno as receiver
void setup(){
Serial.begin(9600);
pinMode(13,OUTPUT);
}
void loop(){
char Data = '2';
if(Serial.available()>0){
Data = Serial.read();
Serial.flush();
}
switch ( Data ) {
case '0':
blink0();
break;
case '1':
blink1();
break;
default :
break;
}
}
void blink0(){
int i=0;
while(i<3){
i++;
digitalWrite(13,HIGH);
delay(500);
digitalWrite(13,LOW);
delay(500);
}
}
void blink1(){
int i=0;
while(i<2){
i++;
digitalWrite(13,HIGH);
delay(100);
digitalWrite(13,LOW);
delay(1000);
}
}
For Leonardo as sender:
Code: Select all//leonardo as sender
boolean flo = 0;
void setup(){
Serial1.begin(9600);
}
void loop(){
Serial1.println(flo);
Serial1.flush();
delay(3000);
flo=!flo;
}
3 Plug into two arduino boards
4 Result
After all above, you could see the Uno LED blink in different way according different data send by another Apc220 on Leonardo.
And I take it downstairs to test its transmission distance:
1. I was in 4 floor, another one( Romeo ) was put on my table on the 6 floor. I could still received the signal.
2 I went out from the building to the lakeside, it's still flashing, the distance might be 100-200m. And there's a lot of buildings around.
Another similar one on both Uno.
2 Sure, it use Serial for data transmission. And most devices could receive serial data.
by the way, I don't know the cool product bbb, thanks for sharing

