mirror of
https://github.com/esp-rs/esp-idf-hal.git
synced 2025-09-27 12:21:02 +00:00
Fix examples
This commit is contained in:
parent
d21ee8d31a
commit
7dc4d9cc5f
@ -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()?;
|
||||
|
@ -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)?;
|
||||
|
||||
|
@ -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());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user