Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daschr/esp_pwm_reader
Wrapper around the mcpwm capture module for reading pwm signals.
https://github.com/daschr/esp_pwm_reader
capture esp-idf esp32 pwm-signal rust
Last synced: 8 days ago
JSON representation
Wrapper around the mcpwm capture module for reading pwm signals.
- Host: GitHub
- URL: https://github.com/daschr/esp_pwm_reader
- Owner: daschr
- Created: 2023-11-19T10:19:51.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-19T13:42:07.000Z (about 1 year ago)
- Last Synced: 2024-11-15T09:47:06.946Z (3 months ago)
- Topics: capture, esp-idf, esp32, pwm-signal, rust
- Language: Rust
- Homepage:
- Size: 1.05 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# esp_pwm_reader
Wrapper around the mcpwm capture module for reading pwm signals.
# Documentation
- see
# Usage
- you need to create a capture timer which can then be used by multiple channel readers
- f.e.
```
use channel_reader::{CaptureTimer, ChannelReader};
use esp_idf_hal::delay::FreeRtos;use esp_idf_sys::{
gpio_num_t_GPIO_NUM_16, gpio_num_t_GPIO_NUM_17
};fn main() {
let capture_timer = CaptureTimer::new(0).unwrap();let channel1 = ChannelReader::new(&capture_timer, gpio_num_t_GPIO_NUM_16).unwrap();
let channel2 = ChannelReader::new(&capture_timer, gpio_num_t_GPIO_NUM_17).unwrap();loop {
println!(
"ch1: {} ch2: {}",
channel1.get_value(),
channel2.get_value()
);FreeRtos::delay_ms(11);
}
}
```