明石高専ロボ研 mbedライブラリ
Dependents: MDD_L432KC USB2RS485 pathtracking odometry ... more
Diff: neopixel.h
- Revision:
- 5:a7894e6982ea
- Parent:
- 0:ca84ed7518f5
- Child:
- 7:4ad54efe2fdd
diff -r 39ef4d91dc34 -r a7894e6982ea neopixel.h --- a/neopixel.h Fri Jul 24 14:12:15 2020 +0000 +++ b/neopixel.h Thu Nov 12 16:38:23 2020 +0000 @@ -1,6 +1,7 @@ #ifndef NEOPIXEL_H #define NEOPIXEL_H #include "mbed.h" +#include <vector> /* // Example @@ -52,15 +53,24 @@ class NeoPixelOut : DigitalOut { private: void byte(uint32_t b); - int boad_; + int board_; + int num_pixels_; + vector<Pixel> strip_; public: bool normalize; float global_scale; - NeoPixelOut(PinName pin); + NeoPixelOut(PinName pin, int num = 0); void send(Pixel *colors, uint32_t count, bool flipwait=true); + void changeNum(uint32_t num); + void setBrightness(float brightness);//0~1 + void setPixelColor(uint32_t i,uint32_t color); + void show(); + void off(bool flag = true); + uint32_t color(uint32_t b,uint32_t g,uint32_t r); + int numPixels(); /** Wait long enough to make the colors show up */ void flip(void);