blink

blinking led(s)
git clone [email protected]:dracuxan/blink.git
Log | Files | Refs | README

README.md (1309B)


      1 # blink
      2 
      3 Rust project for **Arduino Nano** experiments. Each module contains the logic for a different project — swap which one runs from `src/main.rs`.
      4 
      5 ## Modules
      6 
      7 | Module       | File                | Description                                                                            |
      8 | ------------ | ------------------- | -------------------------------------------------------------------------------------- |
      9 | `blink_led`  | `src/blink_led.rs`  | Built-in LED on D13 toggles every 500ms                                                |
     10 | `flame_pump` | `src/flame_pump.rs` | Reads flame sensor on A0, prints value to serial, runs pump via L298N when value < 125 |
     11 
     12 ## Usage
     13 
     14 In `src/main.rs`, uncomment the module you want to flash:
     15 
     16 ```rust
     17 #[arduino_hal::entry]
     18 fn main() -> ! {
     19     blink_led::run()
     20     // flame_pump::run()
     21 }
     22 ```
     23 
     24 Then build and flash:
     25 
     26 ```bash
     27 cargo run
     28 ```
     29 
     30 `ravedude` opens a serial console after flashing (57600 baud).
     31 
     32 ## Requirements
     33 
     34 - `avr-gcc`, `avr-libc`, `avrdude`, [`ravedude`](https://crates.io/crates/ravedude)
     35 - See the [`avr-hal` README](https://github.com/Rahix/avr-hal#readme)
     36 
     37 ## Adding a new module
     38 
     39 1. Create `src/my_module.rs` with a `pub fn run() -> !` entry point.
     40 2. Add `mod my_module;` in `src/main.rs`.
     41 3. Call `my_module::run()` from `main()`.