mirror of
https://github.com/ImplFerris/esp32-book.git
synced 2025-09-24 14:31:13 +00:00
high speed channel
This commit is contained in:
parent
17aeef3bd6
commit
6c7f1dcc68
@ -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
src/projects.md
Normal file
8
src/projects.md
Normal file
@ -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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user