Hi. I'm working on an FM radio project with an Arduino Mega 2560.
I have a btn variable that I'd like to pass to a function, but I can't figure out how to do it.
let mut adc = arduino_hal::Adc::new(dp.ADC, Default::default());
let btn = pins.a0.into_analog_input(&mut adc);
I'm getting the following error, which makes sense: error[E0277]: the trait bound avr_hal_generic::port::Pin<Analog, T>: AdcChannel<_, _> is not satisfied
Instead of Pin<Analog, T> I should use something like Pin<Analog, PF0> but I don't know how to access PF0.
One thing I struggle with as a beginner in Rust is passing the right type, or even knowing what type something is. This is a nice little function to print out the type, then I copy and paste the output.