private PwmDriverSingleton()
 {
     Task.Factory.StartNew(async() =>
     {
         this._driver = await PwmDriver.Init();
     });
 }
Example #2
0
 public PinController(int bcmIndex, int dutyCycle = 0)
 {
     BcmIndex  = bcmIndex;
     Pin       = Pi.Gpio.GetGpioPinByBcmPinNumber(bcmIndex);
     PwmDriver = Pin.Capabilities.Contains(PinCapability.PWM) ? (IPwmDriver) new HardwarePwmDriver(Pin) : new SoftwarePwmDriver(Pin);
     PwmDriver.SetDutyCylce(dutyCycle);
 }