i am using this short program..
Servo myservo;
int pos = 0;
void setup()
{
myservo.attach(9);
}
void loop() {
incomingByte = Serial.read();
while ( incomingByte == 97 && Serial.available () == 0) //left aileron
{
myservo.write(45);
}
while ( incomingByte == 100 && Serial.available () == 0) //right aileron
{
myservo.write(135);
}
while ( incomingByte == 119 && Serial.available () == 0) //pitch down
{
myservo.write(45);
}
}
alright, i understand this program sends a 45 degree to the servo, and i believe the servo is output pin 1. how should i modify this program, or maybe the variables, to allow me to control more ch at the same time instead of 1. in this case, as from the program above, my third one is to control pitch, which is ch 2, but i cant get ch 2 moving, no matter what chat i type, ch 1 will move. is it due to the declaring of myservo.attach(9)?
if yes, how to i modify it?
1 more question:
what is the code that sends the signal to the brushless motor to allow the motor to rotate? like for the servo case, its myservo.write..
thanks..
darren