This is a Shield Bot Library
ColorPixels Class Reference
Color pixels class using WS2812B and nRF51822 (16Hz) More...
#include <ShieldBot_v12.h>
Public Member Functions | |
ColorPixels (uint8_t pin, uint16_t num) | |
Initilaze. | |
void | set_color (uint16_t index, uint8_t r, uint8_t g, uint8_t b) |
Set the color of a pixel (without update) | |
void | update () |
Update. | |
void | clear () |
Turn off all pixels. |
Detailed Description
Color pixels class using WS2812B and nRF51822 (16Hz)
Example:
#include "mbed.h" #include "color_pixels.h" ColorPixels pixels(1, 32); int main() { pixels.set_color(0, 0, 255, 0); pixels.update(); while(1) { } }
Definition at line 62 of file ShieldBot_v12.h.
Constructor & Destructor Documentation
ColorPixels | ( | uint8_t | pin, |
uint16_t | num | ||
) |
Initilaze.
- Parameters:
-
pin number of GPIO num number of pixels
Definition at line 123 of file ShieldBot_v12.cpp.
Member Function Documentation
void clear | ( | ) |
Turn off all pixels.
Definition at line 193 of file ShieldBot_v12.cpp.
void set_color | ( | uint16_t | index, |
uint8_t | r, | ||
uint8_t | g, | ||
uint8_t | b | ||
) |
Set the color of a pixel (without update)
- Parameters:
-
index index of a pixel r red g green b blue
Definition at line 147 of file ShieldBot_v12.cpp.
void update | ( | ) |
Update.
Definition at line 172 of file ShieldBot_v12.cpp.
Generated on Fri Jul 15 2022 04:55:56 by 1.7.2