Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: STM32FC_RGB_WS2812
WS2812.h
- Committer:
- devararendy
- Date:
- 2016-12-10
- Revision:
- 1:8910a1fcbdb0
- Parent:
- 0:f080cb888db6
File content as of revision 1:8910a1fcbdb0:
#ifndef WS2812_H
#define WS2812_H
#include "mbed.h"
#include "USBSerial.h"
class WS2812
{
public:
uint8_t Red;
uint8_t Green;
uint8_t Blue;
WS2812(PinName pin, int qty);
~WS2812();
void writeColor(uint32_t RGB);
void send1Color(uint32_t RGB);
void sendColors(uint32_t * ColorBuffer);
void sendReset();
private:
int LED_Qty;
PinName dataPin;
DigitalOut dataOut;
void writeByte(uint8_t data);
void send0();
void send1();
};
#endif