mirror of
https://github.com/guilhermewerner/rust-avr
synced 2025-06-16 05:44:19 +00:00
Basic arduino blink
This commit is contained in:
19
Source/Main.rs
Normal file
19
Source/Main.rs
Normal file
@ -0,0 +1,19 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
#![allow(non_snake_case)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use panic_halt as _;
|
||||
|
||||
#[arduino_hal::entry]
|
||||
fn main() -> ! {
|
||||
let peripherals = arduino_hal::Peripherals::take().unwrap();
|
||||
let pins = arduino_hal::pins!(peripherals);
|
||||
|
||||
let mut led = pins.d13.into_output();
|
||||
|
||||
loop {
|
||||
led.toggle();
|
||||
arduino_hal::delay_ms(1000);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user