change ruduino to arduino-hal
parent
5b2648440f
commit
6244ace8f0
|
@ -4,7 +4,8 @@ version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ruduino = { git = "https://github.com/avr-rust/ruduino", branch = "master" }
|
arduino-hal = { git = "https://github.com/rahix/avr-hal", features = ["arduino-uno"] }
|
||||||
|
panic-halt = "0.2.0"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = true
|
lto = true
|
||||||
|
|
19
src/main.rs
19
src/main.rs
|
@ -1,18 +1,19 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
use ruduino::cores::current::port::B5 as led;
|
use arduino_hal::delay_ms;
|
||||||
use ruduino::delay::delay_ms;
|
use panic_halt as _;
|
||||||
use ruduino::Pin;
|
|
||||||
|
|
||||||
#[no_mangle]
|
#[arduino_hal::entry]
|
||||||
pub extern "C" fn main() -> ! {
|
fn main() -> ! {
|
||||||
led::set_output();
|
let peripherals = arduino_hal::Peripherals::take().unwrap();
|
||||||
|
let pins = arduino_hal::pins!(peripherals);
|
||||||
|
|
||||||
|
let mut led = pins.d13.into_output();
|
||||||
|
led.set_high();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
led::set_high();
|
led.toggle();
|
||||||
delay_ms(1000);
|
|
||||||
led::set_low();
|
|
||||||
delay_ms(1000);
|
delay_ms(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue