Servo issue

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Post Reply
Message
Author
Shimokuta
Posts: 113
Joined: Wed Feb 03, 2021 12:52 pm

Servo issue

#1 Post by Shimokuta »

I guess i am missing something very obvious about using a regular SG90 servo with an Arduino MEGA
I am testing this but the servo won't move.
Brown wire is connected to GNR
Red wire is connected to 5v
Orange wire is connected to D7 of the Arduino MEGA at channel A
I am testing this script:

Code: Select all

output_id = hw_output_pwm_add("ARDUINO_MEGA2560_A_D7", 50, 0.05)
function FlapsPOS(flaps)
hw_output_pwm_duty_cycle(output_id, 0.05 + (0.1 * flaps) )
end
fsx_variable_subscribe("FLAPS HANDLE PERCENT", "Percent Over 100", FlapsPOS)
Servo and arduino do function; when i test the same with Mobiflight all is fine....
What am i missing here??

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Servo issue

#2 Post by Ralph »

Have you looked at the hardware ID list?
http://siminnovations.com/wiki/index.ph ... _MEGA_2560
Check out the comments. You'll have to use D6 for example.

Shimokuta
Posts: 113
Joined: Wed Feb 03, 2021 12:52 pm

Re: Servo issue

#3 Post by Shimokuta »

aahhhhhh...didn't noticed that!
connecting to pin 6 did work.
I knew it would be something obvious like that... :D

Thanks!!!!

Post Reply