blink

blinking led(s)
git clone igris.git:dracuxan/blink.git
Log | Files | Refs | README

commit e1929611000118e4670c4e6a26d6587444735707
parent fbc1b8e3a6181b5f3be06aeabe4b6b24c3516cb5
Author: dracuxan <[email protected]>
Date:   Sun, 24 May 2026 21:47:50 +0530

batman

Diffstat:
MRavedude.toml | 2+-
Msrc/main.rs | 30++++++++++++++++++------------
2 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/Ravedude.toml b/Ravedude.toml @@ -1,5 +1,5 @@ [general] -board = "nano-new" +board = "nano" # After flashing, open the serial console at 57600 baud. open-console = true serial-baudrate = 57600 diff --git a/src/main.rs b/src/main.rs @@ -8,20 +8,26 @@ fn main() -> ! { let dp = arduino_hal::Peripherals::take().unwrap(); let pins = arduino_hal::pins!(dp); - /* - * For examples (and inspiration), head to - * - * https://github.com/Rahix/avr-hal/tree/main/examples - * - * NOTE: Not all examples were ported to all boards! There is a good chance though, that code - * for a different board can be adapted for yours. The Arduino Uno currently has the most - * examples available. - */ - - let mut led = pins.d13.into_output(); + let mut pin2 = pins.d2.into_output(); + let mut pin4 = pins.d4.into_output(); + let mut pin6 = pins.d6.into_output(); + let mut pin8 = pins.d8.into_output(); loop { - led.toggle(); + pin2.set_high(); + arduino_hal::delay_ms(1000); + pin2.set_low(); + + pin4.set_high(); + arduino_hal::delay_ms(1000); + pin4.set_low(); + + pin6.set_high(); + arduino_hal::delay_ms(1000); + pin6.set_low(); + + pin8.set_high(); arduino_hal::delay_ms(1000); + pin8.set_low(); } }