C_Newb Asks for Help on PWM Program
briank77479
Posts: 36
I've recently began working with C through the Simple IDE and tutorials. I thought I'd try my hand at creating a program to control two DC motors using the Activity Board connected to two L298 Motor Control boards from Solarbotics. Each board is capable of driving two motors, but for this experiment I connected one motor to one board. Each drive circuit requires 3 pins, two to determine direction and the third to except the PWM signal. I created the "Each Motor Separate" code to check that I could control the motors and I was successful. So I created the "Dual Motor" code to control them simultaneously. Unfortunately when I ran the program only one motor would work; the motor connected through pins 0-2. The direction lights on both boards would light up, But only one motor would ramp up as the code intended. Swapped cables, changed the "channel" in the code, changed the order in which pin group was listed first. It didn't matter it seemed that only the motor board connected through pins 0-2 worked. The only time I could get the motor controlled through pins 4-6 was to comment out any reference to pins 0-2.
I seek guidance on what I'm doing wrong. I feel I'm overlooking something basic.
Thank you in advance for your help.
Brian
I seek guidance on what I'm doing wrong. I feel I'm overlooking something basic.
Thank you in advance for your help.
Brian
Comments
results in
Not sure if you've already tried the example here, but in case not...
...Documents\SimpleIDE\Learn\Examples\Devices\Motor\DC\Two DC Motors 60 Percent.side
That was a big help!! Separating the Low statements was correct. Will try the project mentioned by Andy.
Again, Thank you very much for this!!
Brian