Simple neopixel (WS2812) library, tuned for stm32 (L432) at 80 MHz Should be compatible with any stm32, different clock speed may require timing adjustments in neopixel.c
Dependents: Nucleo_neopixel_ovgu Nucleo_neopixel_ovgu1 Nucleo_neopixel_ovgu3
Fork of NeoPixel by
neopixel.h
- Committer:
- Hinz
- Date:
- 2017-12-11
- Revision:
- 1:037882a8e193
- Parent:
- 0:a81364d9a67b
File content as of revision 1:037882a8e193:
#ifndef NEOPIXEL_H #define NEOPIXEL_H #include "mbed.h" union Pixel { struct __attribute__((packed)) { uint8_t b; uint8_t g; uint8_t r; uint8_t a; // unused }; uint32_t hex; }; class NeoPixel : DigitalOut { private: void byte(uint32_t b); int _npixels; Pixel *_pixels; public: NeoPixel(PinName, int ); void show(void); void setColor(int, uint32_t); void clear(void); }; #endif /* NEOPIXEL_H */