|
@@ -8,6 +8,7 @@ use panic_halt as _;
|
|
fn main() -> ! {
|
|
fn main() -> ! {
|
|
let dp = arduino_hal::Peripherals::take().unwrap();
|
|
let dp = arduino_hal::Peripherals::take().unwrap();
|
|
let pins = arduino_hal::pins!(dp);
|
|
let pins = arduino_hal::pins!(dp);
|
|
|
|
+ let mut serial = arduino_hal::default_serial!(dp, pins, 115200);
|
|
|
|
|
|
// for some reason without this the builtin LED would always turn on/off together with the red LED.
|
|
// for some reason without this the builtin LED would always turn on/off together with the red LED.
|
|
let mut builtin_led = pins.d13.into_output();
|
|
let mut builtin_led = pins.d13.into_output();
|
|
@@ -25,14 +26,15 @@ fn main() -> ! {
|
|
|
|
|
|
loop {
|
|
loop {
|
|
if button.is_high() {
|
|
if button.is_high() {
|
|
|
|
+ ufmt::uwriteln!(&mut serial, "Button pressed!").unwrap();
|
|
// signal coming
|
|
// signal coming
|
|
yellow_led.set_high();
|
|
yellow_led.set_high();
|
|
- delay_ms(1000);
|
|
|
|
|
|
+ delay_ms(2000);
|
|
// green
|
|
// green
|
|
red_led.set_low();
|
|
red_led.set_low();
|
|
yellow_led.set_low();
|
|
yellow_led.set_low();
|
|
green_led.set_high();
|
|
green_led.set_high();
|
|
- delay_ms(10_000);
|
|
|
|
|
|
+ delay_ms(6_000);
|
|
// signal leaving
|
|
// signal leaving
|
|
green_led.set_low();
|
|
green_led.set_low();
|
|
yellow_led.set_high();
|
|
yellow_led.set_high();
|