1 Star 0 Fork 0

葱先生/ESP32-NeoPixel-WS2812-RMT

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
ws2812_control.h 747 Bytes
Copy Edit Raw Blame History
odx authored 2020-08-23 13:56 . converted to esp-idf component
#ifndef WS2812_CONTROL_H
#define WS2812_CONTROL_H
#include <stdint.h>
#include "sdkconfig.h"
#define NUM_LEDS CONFIG_WS2812_NUM_LEDS
// This structure is used for indicating what the colors of each LED should be set to.
// There is a 32bit value for each LED. Only the lower 3 bytes are used and they hold the
// Red (byte 2), Green (byte 1), and Blue (byte 0) values to be set.
struct led_state {
uint32_t leds[NUM_LEDS];
};
// Setup the hardware peripheral. Only call this once.
void ws2812_control_init(void);
// Update the LEDs to the new state. Call as needed.
// This function will block the current task until the RMT peripheral is finished sending
// the entire sequence.
void ws2812_write_leds(struct led_state new_state);
#endif
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/himrcong/ESP32-NeoPixel-WS2812-RMT.git
git@gitee.com:himrcong/ESP32-NeoPixel-WS2812-RMT.git
himrcong
ESP32-NeoPixel-WS2812-RMT
ESP32-NeoPixel-WS2812-RMT
master

Search