---
title: "Discussion on \"ESP32 Standard Library Embedded Rust: PWM Servo Motor Sweep\" | Hashnode"
description: "Discussion on \"ESP32 Standard Library Embedded Rust: PWM Servo Motor Sweep\". This blog post is the fifth of a multi-part series of posts where I explore various peripherals in the ESP32C3 using standard library embedded Rust and the esp-idf-hal. Please be aware that certain co"
url: "https://hashnode.com/posts/esp32-standard-library-embedded-rust-pwm-servo-motor-sweep/64d5f086de5e3e6bcfc23c0c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [ESP32 Standard Library Embedded Rust: PWM Servo Motor Sweep](https://blog.theembeddedrustacean.com/esp32-standard-library-embedded-rust-pwm-servo-motor-sweep?utm_source=hashnode&utm_medium=feed)

This blog post is the fifth of a multi-part series of posts where I explore various peripherals in the ESP32C3 using standard library embedded Rust and the esp-idf-hal. Please be aware that certain co

Aug 11, 2023 · 11 min read · blog.theembeddedrustacean.com  
Updated Jul 1  
Read the article

-   [#rust](https://hashnode.com/tag/rust)
-   [#tutorial](https://hashnode.com/tag/tutorial)
-   [#esp32](https://hashnode.com/tag/esp32)
-   [#beginner](https://hashnode.com/tag/beginner)
-   [#embedded-systems](https://hashnode.com/tag/embedded-systems)

## Written by

[Omar Hiari](https://hashnode.com/@omarhiari)

@omarhiari

  
[View profile](https://hashnode.com/@omarhiari)

I am an 📟 Embedded Engineer with years of experience in both industry 🏭 and academia 🏫. Passionate Mentor 👨‍💼 and Instructor 👨‍🏫. Rustacean 🦀

## Responses 1

Markdown supported · ⌘↵ to post

[juebanlin](https://hashnode.com/@juebanlin)

[Sep 14, 2023](https://hashnode.com/posts/esp32-standard-library-embedded-rust-pwm-servo-motor-sweep/64d5f086de5e3e6bcfc23c0c/comment/650273bd6c527edfe705ffc9)

In the stm32 hal environment:

How can a 4 PIN (GND VCC FG PWM) PWM fan current speed be read through the fan FG pin?

Timer mode statistics or exti interrupt? Can you provide examples separately? Thank you.

[juebanlin](https://hashnode.com/@juebanlin)

[Sep 14, 2023](https://hashnode.com/posts/esp32-standard-library-embedded-rust-pwm-servo-motor-sweep/64d5f086de5e3e6bcfc23c0c/comment/650273bd6c527edfe705ffc9#reply-6502cbaffb3b16e3da3d01ea)

[Omar Hiari](https://hashnode.com/@omarhiari) If using HAL, I can only rely on polling or EXTI interrupts to count, because I also don't want to use PAC, which is too complicated.

Although Trust stm32 hal is very convenient, there are many APIs and usage methods for the hal library that do not provide examples of how to use them. I hope you can provide more examples of how to use the hal library in the future.

For example, I learned from you about non blocking examples such as HAL library timers.

Can you write more examples of HAL libraries combined with various peripherals? For example, EC11 signal input, PWM FG signal input

[Omar Hiari](https://hashnode.com/@omarhiari)

[Sep 14, 2023](https://hashnode.com/posts/esp32-standard-library-embedded-rust-pwm-servo-motor-sweep/64d5f086de5e3e6bcfc23c0c/comment/650273bd6c527edfe705ffc9#reply-650317416c527edfe706134d)

[juebanlin](https://hashnode.com/@juebanlin) I have created a full STM32 strictly hal-based series in the past that you can find [here](https://apollolabsblog.hashnode.dev/series/stm32f4-embedded-rust-hal). There is also a series using the STM32 with embassy. The closest example to what you are looking for is probably the ultrasonic measurement with timers.

Regarding more examples, that is always a goal, but time is always tight, and I am always trying my best to generate more. As for the FG input, I don't have such hardware readily available but the concept of how to measure is largely similar to examples I already developed. For example, the earlier example I shared about the squarewave generator input connected the ESP, that would be exactly the same logic you would utilize to measure the frequency of an FG signal.

[juebanlin](https://hashnode.com/@juebanlin)

[Sep 15, 2023](https://hashnode.com/posts/esp32-standard-library-embedded-rust-pwm-servo-motor-sweep/64d5f086de5e3e6bcfc23c0c/comment/650273bd6c527edfe705ffc9#reply-6503b7fa770802e8a4add06e)

[Omar Hiari](https://hashnode.com/@omarhiari) Thank you very much. I will continue to follow you and hope you can publish more articles about Trust embedded
