var sb = new ShieldBase(GoSockets.Socket5);
// Defines the H-Bridge IC on the correct pins
var motorDriver = new HBridge(sb.PWMChannels.PWM_4, sb.Pins.GPIO_PIN_D5, sb.PWMChannels.PWM_3, sb.Pins.GPIO_PIN_D2);
Hi Allan,
The Shield Base is an awesome addition to the Netduino Go platform, however, unfortunately it is still in beta and has some bugs with PWM. They are working on a fix for the PWM of which should be released in the near future.
I also noticed that your pin assignments may be a little off. The HBridge class expects the following arguments, speed control 1(PWM), direction 1, speed control 2, direction 2. You have provided four, but I'm not sure which actual digital pins you are using. PWM is only available on certain digital pins, and for the most part the Shield Base follows the
same pinout as the Netduino Plus, however there isn't a lot of information out there at the moment regarding which digital pins PWM_0 to PWM_5 are referring to. If you look at the
schematics of the shield base we can see that PWM_0 is found on D5, PWM_1 on D6, PWM_2 on D9 and PWM_3 on D10. The extra two are uncertain at the moment.
In your code you use PWM_4 for the speed control and D5 as the direction of motor 1. Since, we aren't sure of the PWM_4 perhaps it would be best to use PWM_2 (D9). You can still use D5 for the motor direction, however down the road you may want to keep it free for something else requiring PWM.
Hopefully this isn't too long winded and you can have you code ready for when the firmware for the shield base is updated.
Cheers,
Steve
Update: Sorry didn't, I see Stephen
had beat me to the punch. And PWM_4 is D3!!!