G120 how to set pwm 8-11?

hi every one

I have a quick question. how to setup pwm port 8-11?

PWM 0-7, works fine the following way:

 
PWM Cookie = new PWM(Cpu.PWMChannel.PWM_0, Freq, Dutycycle, false);

I can see that there is only define pwm 0-7 in “Cpu.PWMChannel”


        public enum PWMChannel
        {
            PWM_NONE = -1,
            PWM_0 = 0,
            PWM_1 = 1,
            PWM_2 = 2,
            PWM_3 = 3,
            PWM_4 = 4,
            PWM_5 = 5,
            PWM_6 = 6,
            PWM_7 = 7,
        }

@ Larsc -

[quote]
PWM port 8-11[/quote]

PWM on port 8, pin 11
or PWM id from 8 to 11?

PWM id from 8 to 11

@ Larsc -

The following example is how you set a PWM channel higher than the allotted enumerations:

PWM Cookie = new PWM((Cpu.PWMChannel)8, Freq, Dutycycle, false);

You only need to type cast the number as that channel type.

@ Aron

Thanks, I got it to work yesterday, I use the same method :slight_smile: