Paul_KD7HB
main.cpp is in the program because I am using platforio on atom.
raschemmel
I don't really get what you are asking. I mean there is a receiver with wires: two power wires and 6 signal wires to the Arduino due pins 2, 3, 4, 5, 6, 7.
The reason I am not using PulseIn is that there are 6 more channels. It would significantly slow down the program to use PulseIn for all 6 channels.
ard_newbie
The reason I am using a double is for convenience, in the parts that are commented out I am doing a bunch of divisions. So instead of typecasting everything I just made it a double.
EDIT
Servo swasplate[3]; //create an array with 3 servo objects
for (int a = 0; a < 3; a++)
swasplate[a].attach(10+a, 1200, 1800);
//attach servos to pins 10 11 12
//prevent it from destroying my swashplate by setting limits 1200 1800
swasplate[0].write(rc_raw[0]);
//write the value of the receiver straight to the first servo in the array, so the servo with pin 10.