(byte) vs. (AnalogIn.Pin)


First my apologies, as I hate to use forums for 1st level support, but I’m a little stumped and am wondering if my problem is related to the SDK update.

Whenever I see in the drivers a byte cast to a FEZ pin (analog or digital):

Distance Detector Component: adc = new AnalogIn((byte)pin);

Motor Driver Shield: _pwm1 = new PWM((byte)FEZ_Pin.PWM.Di5);

I get the compile time error:

error CS1503: Argument ‘1’: cannot convert from ‘byte’ to 'GHIElectronics.NETMF.Hardware.PWM.Pin’

I’ve worked around this so far with casting to the pin type:

Distance Detector Component: adc = new AnalogIn((AnalogIn.Pin)pin);

I was thinking maybe the drivers needed updated too? Sorry for the rookie question!



Yes, you are correct and solution is correct too.

We will fix the files as necessary.

Wow, thanks! I’ve been in tech support for 5 years and haven’t seen an answer that quick!

I thought maybe I was doing something wrong, because I couldn’t resist the urge to start coding (my domino is still in the mail:)).

I gotta say, I’m really excited about this thing. You guys have done an awesome job on the sdk and documentation.


Glad you find it useful. We look forward to see the amazing things you will be making :wink: