From 207417033629eecf9e3a97baf5c8787e1ddf8969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Wed, 17 Nov 2021 18:47:18 +0100 Subject: update deps to new avr-hal structure --- src/main.rs | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 0059fde..21f894b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,22 +1,16 @@ #![no_std] #![no_main] -use arduino_uno::prelude::*; use panic_halt as _; -#[arduino_uno::entry] +#[arduino_hal::entry] fn main() -> ! { - let dp = arduino_uno::Peripherals::take().unwrap(); + let dp = arduino_hal::Peripherals::take().unwrap(); + let pins = arduino_hal::pins!(dp); - let mut pins = arduino_uno::Pins::new(dp.PORTB, dp.PORTC, dp.PORTD); + // Digital pin 13 is also connected to an onboard LED marked "L" + let mut led = pins.d13.into_output(); + led.set_high(); - let mut led = pins.d13.into_output(&mut pins.ddr); - led.set_low().void_unwrap(); - - loop { - led.set_high().void_unwrap(); - arduino_uno::delay_ms(50); - led.set_low().void_unwrap(); - arduino_uno::delay_ms(950); - } + loop {} } -- cgit v1.2.1