//RgbLed(Cpu.Pin red, Cpu.Pin green, Cpu.Pin blue, string name) public RgbLedPwm(Cpu.PWMChannel red, Cpu.PWMChannel green, Cpu.PWMChannel blue, string name) : base((Cpu.Pin)red, (Cpu.Pin)green, (Cpu.Pin)blue, name, "rgbledpwm") { ls[0] = new pwmledState() { led = new PWM(red, PulsePeriodInMicroseconds, 0, PWM.ScaleFactor.Microseconds, false) }; ls[1] = new pwmledState() { led = new PWM(green, PulsePeriodInMicroseconds, 0, PWM.ScaleFactor.Microseconds, false) }; ls[2] = new pwmledState() { led = new PWM(blue, PulsePeriodInMicroseconds, 0, PWM.ScaleFactor.Microseconds, false) }; ((pwmledState)ls[0]).led.Start(); ((pwmledState)ls[1]).led.Start(); ((pwmledState)ls[2]).led.Start(); }
public RgbLedPwm(Cpu.PWMChannel red, Cpu.PWMChannel green, Cpu.PWMChannel blue, string name) //RgbLed(Cpu.Pin red, Cpu.Pin green, Cpu.Pin blue, string name) : base((Cpu.Pin)red, (Cpu.Pin)green, (Cpu.Pin)blue, name, "rgbledpwm") { ls[0] = new pwmledState() { led = new PWM(red, PulsePeriodInMicroseconds, 0, PWM.ScaleFactor.Microseconds, false) }; ls[1] = new pwmledState() { led = new PWM(green, PulsePeriodInMicroseconds, 0, PWM.ScaleFactor.Microseconds, false) }; ls[2] = new pwmledState() { led = new PWM(blue, PulsePeriodInMicroseconds, 0, PWM.ScaleFactor.Microseconds, false) }; ((pwmledState)ls[0]).led.Start(); ((pwmledState)ls[1]).led.Start(); ((pwmledState)ls[2]).led.Start(); }