Fix examples

This commit is contained in:
ivmarkov 2022-09-06 18:20:24 +03:00 committed by Ivan Markov
parent d21ee8d31a
commit 7dc4d9cc5f
3 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ fn main() -> anyhow::Result<()> {
esp_idf_sys::link_patches();
let peripherals = Peripherals::take().unwrap();
let mut led = PinDriver::new(peripherals.pins.gpio4)?.into_output()?;
let mut led = PinDriver::output(peripherals.pins.gpio4)?;
loop {
led.set_high()?;

View File

@ -17,8 +17,8 @@ fn main() -> anyhow::Result<()> {
esp_idf_sys::link_patches();
let peripherals = Peripherals::take().unwrap();
let mut led = PinDriver::new(peripherals.pins.gpio4)?.into_output()?;
let mut button = PinDriver::new(peripherals.pins.gpio9)?.into_input()?;
let mut led = PinDriver::output(peripherals.pins.gpio4)?;
let mut button = PinDriver::input(peripherals.pins.gpio9)?;
button.set_pull(Pull::Down)?;

View File

@ -42,7 +42,7 @@ fn main() -> anyhow::Result<()> {
let tx = send_morse_code(&mut channel, &mut led, &config, "HELLO ")?;
let stop = PinDriver::new(stop)?.into_input()?;
let stop = PinDriver::input(stop)?;
println!("Keep sending until pin {} is set low.", stop.pin());