multiple PwmOut pins
- This topic has 1 reply, 2 voices, and was last updated 8 years, 8 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Tagged: mdot PwmOut RGBW
Does the mdot mbed support multiple PwmOut channels?
I’d like to set up 4 channels (RGBW) like this:
#include “mbed.h”
PwmOut ledR(PA_8);
PwmOut ledG(PA_9);
PwmOut ledB(PA_12);
PwmOut ledW(PA_11);
//I’m ok with them all sharing the same timer/period.
ledW.period_ms = 2;
//Then set the color fraction as needed
ledR = 0.01f;
ledG = 0.3f;
ledB = 0.4f;
ledW = 0.0f;
//(more programatically of course sending colors from the Conduit…
Gavin,
PeripheralPins.c in the mDOt platform support lists all the pins that are PWM capable.
I did some reading on this and it sounds like pins that are run by the same timer must have the same frequency, but each can have a different duty cycle (just FYI since you said you were OK with this).
PA_12 is not listed as a PWM capable pin, so you’ll need to find a replacement for that one.
Hope this helps!
-Mike