Forum >APC220 communication between 2 boards
General

APC220 communication between 2 boards

userHead Leff 2015-03-24 23:27:00 12712 Views4 Replies

 

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.

2015-07-01 00:51:05 1 the available range should be what the software allows to set. And any obstacle could interfere the signal including wall, besides, other signals like wifi, bluetooth, radio etc can also affect the signal.

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 :)
userHeadPic Leff
2015-06-09 00:32:51 Thanks for sharing.
very nice
userHeadPic eosintickleear
2015-06-02 02:25:36 Very clear tutorial, Cool! userHeadPic Grey.CC
2015-03-25 03:48:01 Nice, thanks for sharing! :D userHeadPic Jose