Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

IGpioPin does not allow access to PWM functions #30

Open
BryanCrotaz opened this issue Jul 4, 2020 · 5 comments
Open

IGpioPin does not allow access to PWM functions #30

BryanCrotaz opened this issue Jul 4, 2020 · 5 comments
Assignees

Comments

@BryanCrotaz
Copy link

BryanCrotaz commented Jul 4, 2020

IGpioPin does not give access to all PWM functions.

In Workbench, the Servo demo should take an IGpioPin in the constructor, not a GpioPin.

Alternatively explain in docs how to get a GpioPin instance from
Pi.Gpio[bcmPinNumber]

@wezzix
Copy link

wezzix commented Nov 10, 2020

Try a cast. The readme gives the following example:

   var range = 100;
   var pin = (GpioPin)Pi.Gpio[BcmPin.Gpio24];
   pin.PinMode = GpioPinDriveMode.Output;
   pin.StartSoftPwm(0, range);

@BryanCrotaz
Copy link
Author

Oh that's soooo dodgy! Assuming that the implementation of an interface is an exact class is ripe with error potential.

@wezzix
Copy link

wezzix commented Nov 10, 2020

Yes. I don't know why the maintainers designed it so. Maybe they'd like to chip in?

@BryanCrotaz
Copy link
Author

I've submitted a few improvement PRs but they're withering on the vine

@geoperez
Copy link
Member

We are looking for maintainers, you can apply at https://adoptoposs.org/p/67b02bee-a00e-446a-a321-c1a6449014bc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants