Frequency of MotorLeftPWM

valdasrk

New member
Hi, All,

I noticed, that frequency of MotorLeftPWM is about 960 Hz and two times bigger than MotorRightPWM (about 490 Hz).
The code looks good.
Then I changed following line in aml50.h

Code:
#define pinMotorLeftPWM 3

to

Code:
#define pinMotorLeftPWM 5

and now frequency is equal.
 
Hello Valdas,

I think you mean you changed from Pin4 to Pin5, so left and right motors use the same PWM timer:

For Arduino Mega 2560:
timer 0 (controls pin 13, 4)
timer 1 (controls pin 12, 11)
timer 2 (controls pin 10, 9)
timer 3 (controls pin 5, 3, 2)
timer 4 (controls pin 8, 7, 6)

It's interesting that actually you are the first one who found this out! :)

Thank you!
Alexander
 
Oben