lorenzo_c
Hi everyone! I should control a MG90S servo motor whose PWM frequency is 50Hz. At 0 degrees the TON is 1ms (TOFF is 19ms), at 180 degrees the TON is 2ms (TOFF is 18ms).
I can't fix the PWM frequency on the Arduino Mega at 50Hz.
How can I get what I want? The board is Arduino Mega
Reply 0 0
marwansamir
did you solve it?
Reply 0 0
juanpmoron
I found the following way to drive a servo with an Arduino UNO:

[203128%2F8869819%2Fmceclip0]
 
[203128%2F8869830%2Fmceclip0]
 
To include the library, I had to install the Arduino IDE and nothing else.
 
I previously tried with an existing block (PWM_CONTROLLER) but it didn't work as expected. The servo (SG90) moved but I couldn't understand how to indicate the angle, with some values ​​it moved to a position and with others it remained rotating (?). I didn't understand why.
 
Juan Pablo
Reply 0 0
thiagoralves
This is a great example of how to use the Arduino Extension. Indeed, it can help interface with pretty much anything you can interface using the regular Arduino IDE
Reply 1 0
marwansamir
I'm new to OpenPLC and looking for step-by-step instructions to control a servo motor with an Arduino Mega. If anyone has experience or detailed guides, I'd really appreciate your help.
Reply 0 0
Reply