Hi All,
I just bought my Arduino Uno 2 days ago. Before Arduino, I was using Basic stamp. Arduino's capabilities and society seems amazing. Anyway, I would like to mention that my protyping knowledge is beginner level but my idea is beyond of it I am planning to assist naza with Arduino Uno by connecting ping)) sensors around my quadrotor. At first Reciever signals and sensor signal will be taken by Arduino and sent to Dji Naza contorller.
I wrote a code where i can read and write my receiver signal but I cant arm my Naza when arduino is connected to Naza. This start up code is intended to see whether I can arm or not. It seems that I cant for right now
Thanks for any suggestions in advance
Giray Yillikci
int ch1; // Here's where we'll keep our channel values
int ch2;
int ch3;
int ch4;
int ch5;
//int ch6;
int Pwm1;
int Pwm2;
int Pwm3;
int Pwm4;
int Pwm5;
//int Pwm6;
void setup() {
pinMode(2, INPUT); // Set our input pins as such
pinMode(4, INPUT);
pinMode(7, INPUT);
pinMode(8, INPUT);
pinMode(12, INPUT);
//pinMode(13, INPUT);
pinMode(3, OUTPUT); // Set our output pins as such
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
//pinMode(11, OUTPUT);
Serial.begin(9600); // Pour a bowl of Serial
}
void loop() {
ch1 = pulseIn(2, HIGH, 25000); // Read the pulse width of
ch2 = pulseIn(4, HIGH, 25000); // each channel
ch3 = pulseIn(7, HIGH, 25000);
ch4 = pulseIn(8, HIGH, 25000);
ch5 = pulseIn(12, HIGH, 25000);
//ch6 = pulseIn(13, HIGH, 25000);
Pwm1= map(ch1,900,2100,900,2100);
analogWrite(3,Pwm1);
Pwm2= map(ch2,900,2100,900,2100);
analogWrite(5,Pwm2);
Pwm3= map(ch3,900,2100,900,2100);
analogWrite(6,Pwm3);
Pwm4= map(ch4,900,2100,900,2100);
analogWrite(9,Pwm4);
Pwm5= map(ch5,900,2100,900,2100);
analogWrite(10,Pwm5);
//Pwm6= map(ch6,900,2100,900,2100);
//analogWrite(11,Pwm6);
Serial.print("ch1:");
Serial.println(ch1);
Serial.print("Pwm1:");
Serial.println(Pwm1);
Serial.print("ch2:");
Serial.println(ch2);
Serial.print("Pwm2:");
Serial.println(Pwm2);
Serial.print("ch3:");
Serial.println(ch3);
Serial.print("Pwm3:");
Serial.println(Pwm3);
Serial.print("ch4:");
Serial.println(ch4);
Serial.print("Pwm4:");
Serial.println(Pwm4);
Serial.print("ch5:");
Serial.println(ch5);
Serial.print("Pwm5:");
Serial.println(Pwm5);
Serial.println(); //make some room
//delay(1000);// I put this here just to make the terminal
// window happier
}
Moderator edit:
</mark> <mark>[code]</mark> <mark>
</mark> <mark>[/code]</mark> <mark>
tags added.