1 Star 0 Fork 0

ArsSama/watch

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

实物图

  1. page-1 page-1 ........
Supported Targets ESP32 ESP32-C2 ESP32-C3 ESP32-S2 ESP32-S3

Blink Example

(See the README.md file in the upper level 'examples' directory for more information about examples.)

This example demonstrates how to blink a LED using GPIO or RMT for the addressable LED, i.e. WS2812.

See the RMT examples in the RMT Peripheral for more information about how to use it.

How to Use Example

Before project configuration and build, be sure to set the correct chip target using idf.py set-target <chip_name>.

Hardware Required

  • A development board with Espressif SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
  • A USB cable for Power supply and programming

Some development boards use an addressable LED instead of a regular one. These development boards include:

Board LED type Pin
ESP32-C3-DevKitC-1 Addressable GPIO8
ESP32-C3-DevKitM-1 Addressable GPIO8
ESP32-S2-DevKitM-1 Addressable GPIO18
ESP32-S2-Saola-1 Addressable GPIO18
ESP32-S3-DevKitC-1 Addressable GPIO48

See Development Boards for more information about it.

Configure the Project

Open the project configuration menu (idf.py menuconfig).

In the Example Configuration menu:

  • Select the LED type in the Blink LED type option.
    • Use GPIO for regular LED blink.
  • Set the GPIO number used for the signal in the Blink GPIO number option.
  • Set the blinking period in the Blink period in ms option.

Build and Flash

Run idf.py -p PORT flash monitor to build, flash and monitor the project.

(To exit the serial monitor, type Ctrl-].)

See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.

Example Output

As you run the example, you will see the LED blinking, according to the previously defined period. For the addressable LED, you can also change the LED color by setting the led_strip_set_pixel(led_strip, 0, 16, 16, 16); (LED Strip, Pixel Number, Red, Green, Blue) with values from 0 to 255 in the source file.

I (315) example: Example configured to blink addressable LED!
I (325) example: Turning the LED OFF!
I (1325) example: Turning the LED ON!
I (2325) example: Turning the LED OFF!
I (3325) example: Turning the LED ON!
I (4325) example: Turning the LED OFF!
I (5325) example: Turning the LED ON!
I (6325) example: Turning the LED OFF!
I (7325) example: Turning the LED ON!
I (8325) example: Turning the LED OFF!

Note: The color order could be different according to the LED model.

The pixel number indicates the pixel position in the LED strip. For a single LED, use 0.

Troubleshooting

  • If the LED isn't blinking, check the GPIO or the LED type selection in the Example Configuration menu.

For any technical queries, please open an issue on GitHub. We will get back to you soon.

空文件

简介

启航计划手表 展开 收起
C 等 4 种语言
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ArsSama/watch.git
git@gitee.com:ArsSama/watch.git
ArsSama
watch
watch
master

搜索帮助