-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access the Pins by Index #382
Comments
No, I don't think there is an easy way.
But currently no such thing exitsts, and I'm not sure how useful it would be. |
Thank you for the technological background. I agree with you that adding such thing is probably not utterly useful. I only need it to do some multiplexing and that is problem not the most common use-case for this. |
Hope necromancing to prevent duplicate issues is ok. Maybe you have a solution for me or i gave you a good idea why it could be needed. I'm currently doing it like this: ...
let mut pin_array: [Option<DynPin>; 29] = [
Some(pins.gpio0.into()),
Some(pins.gpio1.into()),
Some(pins.gpio2.into()),
Some(pins.gpio3.into()),
Some(pins.gpio4.into()),
Some(pins.gpio5.into()),
Some(pins.gpio6.into()),
Some(pins.gpio7.into()),
Some(pins.gpio8.into()),
Some(pins.gpio9.into()),
Some(pins.gpio10.into()),
Some(pins.gpio11.into()),
Some(pins.gpio12.into()),
Some(pins.gpio13.into()),
Some(pins.gpio14.into()),
Some(pins.gpio15.into()),
Some(pins.gpio16.into()),
Some(pins.gpio17.into()),
Some(pins.gpio18.into()),
Some(pins.gpio19.into()),
Some(pins.gpio20.into()),
Some(pins.gpio21.into()),
Some(pins.gpio22.into()),
None,
None,
None,
Some(pins.gpio26.into()),
Some(pins.gpio27.into()),
Some(pins.gpio28.into()),
];
...
|
IMHO adding comments to old tickets is ok. However they are not well visible, so it might easily happen that you don't get an answer. |
Hi Jannic. I hoped somebody would see it. If not i would have done something else :) |
Ultimately, any safe function providing this functionality probably needs to contain a data structure similar to your |
I'm fine with that. |
The documentation give a rather good overview of how to access pins using a pin's name. What I could not find though was how to access a pin by index. I would like to avoid matching like this:
Would that be possible to do?
The text was updated successfully, but these errors were encountered: