Skip to content

Commit

Permalink
high speed channel
Browse files Browse the repository at this point in the history
  • Loading branch information
ImplFerris committed Dec 26, 2024
1 parent 17aeef3 commit 6c7f1dc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/led/external-led.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,27 @@ In the code, all you have to do is change the GPIO number from 2 to 5.
let led = peripherals.GPIO5;
```

## High speed channel
There's no fun in just changing one line. Let's use high-speed channel this time. To do that, we have to pass `HighSpeed` struct and update the clock source to use the `HSClockSource` enum.

```rust
let ledc = Ledc::new(peripherals.LEDC);

let mut hstimer0 = ledc.timer::<HighSpeed>(timer::Number::Timer0);
hstimer0
.configure(timer::config::Config {
duty: timer::config::Duty::Duty5Bit,
clock_source: timer::HSClockSource::APBClk,
frequency: 24.kHz(),
})
.unwrap();
```


## Clone the existing project
You can also clone (or refer) project I created and navigate to the `led-highfader` folder.

```sh
git clone https://github.com/ImplFerris/esp32-projects
cd esp32-projects/led-highfader
```
8 changes: 8 additions & 0 deletions src/projects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Curated List of Projects Written in Rust for ESP32

Here is a curated list of projects I found online that are interesting and related to ESP32 and Rust. If you have some interesting projects to showcase, please send a PR :)

- [Solar Inverter](https://github.com/Orange-Murker/solar_inverter): Grid-Tie Solar Inverter with MPPT



0 comments on commit 6c7f1dc

Please sign in to comment.