Hello,
I have some problem about wireless communication on my quadcopter project.I'm using Dorji RF Transceiver modules for this project.Here's datasheet;
http://www.dorji.com/docs/data/DRF7020D13.pdf
But,when quadcopter and remote control sides start to work , i'm taking unwanted datas in quadcopter side.How can i prevent these unwanted datas that i didn't send ???
I added Serial Port Screen of the quadcopter side about this problem,
and added Remote control Board Code and Quadcopter Receiving Part Code
Remote Control Board:
int x[3];
char cond[3]={'A','B','C''};
void setup() {
pinMode(A0,INPUT);
pinMode(A1,INPUT);
pinMode(A2,INPUT);
Serial.begin(9600);
}
void loop() {
x[0]=analogRead(A0);
x[1]=analogRead(A1);
x[2]=analogRead(A2);
x[0]=map(x[0],0,1023,0,255);
x[1]=map(x[1],0,1023,0,255);
x[2]=map(x[2],0,1023,0,255);
for(int i=0;i<3;i++){
Serial.write(cond*);*
_ Serial.write(x*);_
_ }_
_ delay(10);_
_}_
Receiving Part Code:
void UpdateSetPoints() {
if(Serial.available()){
_ if(Serial.read()=='A'){_
_ baseSpeed=Serial.read();_
_ baseSpeed=map(baseSpeed,0,255,970,1970);_
_ delayMicroseconds(10);_
_ }_
_ if(Serial.read()=='B'){_
_ setPointRoll=Serial.read();_
_ setPointRoll=map(setPointRoll,0,255,-30,30);_
_ delayMicroseconds(10);_
_ }_
_ if(Serial.read()=='C'){_
_ setPointPitch=Serial.read();_
_ setPointPitch=map(setPointPitch,0,255,-30,30);_
_ delayMicroseconds(10);_
_ }_
_}}_
_