UPB-FILS-MA / questions

A repository for hosting questions from students regarding lectures and labs.
1 stars 1 forks source link

AnyPin Vs 'static, PIN_X #6

Open NegrilaRares opened 6 months ago

NegrilaRares commented 6 months ago

Question

Is there any detriment to using AnyPin as in the following example as opposed to the static pin?

This is the code I used for ex 5 from lab03:

https://github.com/UPB-FILS-MA/lab-NegrilaRares/blob/main/tests/test.rs

And this is the lab solution I am referring to: https://github.com/UPB-FILS-MA/lab-solutions/blob/main/lab03/ex5/src/bin/solution.rs

Material read

https://docs.embassy.dev/embassy-rp/git/rp2040/gpio/struct.AnyPin.html https://docs.embassy.dev/embassy-rp/git/rp2040/gpio/trait.Pin.html#method.degrade https://dev.to/apollolabsbin/embedded-rust-embassy-gpio-button-controlled-blinking-3ee6

alexandruradovici commented 5 months ago

I think in this case using AnyPin is a better solution. Could you please submit a pull request and change the labs?