nima aghli
/
WS2811
for thww WS2811 RGB
Fork of WS2811 by
WS2811.h@4:46b52a6a943b, 2016-11-23 (annotated)
- Committer:
- nimaaghli
- Date:
- Wed Nov 23 19:41:34 2016 +0000
- Revision:
- 4:46b52a6a943b
- Parent:
- 3:2fbb2f0e79fb
first commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Drohne | 0:c6a6fa47dadc | 1 | /* |
Drohne | 0:c6a6fa47dadc | 2 | * Creator: Matthias Hemmer |
Drohne | 3:2fbb2f0e79fb | 3 | * created: 22.06.2016 |
Drohne | 3:2fbb2f0e79fb | 4 | * Board: Himbed M0+ |
Drohne | 3:2fbb2f0e79fb | 5 | * Processor: LPC11U68 |
Drohne | 0:c6a6fa47dadc | 6 | * |
Drohne | 0:c6a6fa47dadc | 7 | * function: write a register of 8 bits to the WS2811 RGBs |
Drohne | 0:c6a6fa47dadc | 8 | * |
Drohne | 0:c6a6fa47dadc | 9 | * supply voltage: 3V3 |
Drohne | 0:c6a6fa47dadc | 10 | * data wire: 5V |
Drohne | 0:c6a6fa47dadc | 11 | * GND: 0V |
Drohne | 0:c6a6fa47dadc | 12 | * |
Drohne | 0:c6a6fa47dadc | 13 | * bit: 255 brightest |
Drohne | 0:c6a6fa47dadc | 14 | * bit: 0 darkest |
nimaaghli | 4:46b52a6a943b | 15 | */ |
nimaaghli | 4:46b52a6a943b | 16 | #include "mbed.h" |
Drohne | 0:c6a6fa47dadc | 17 | |
nimaaghli | 4:46b52a6a943b | 18 | #define HIGH_SIGNAL 9 // Logic 1 |
Drohne | 0:c6a6fa47dadc | 19 | #define LOW_SIGNAL 1 // Logic 0 |
nimaaghli | 4:46b52a6a943b | 20 | #define DELAY 0.00000000001 |
nimaaghli | 4:46b52a6a943b | 21 | |
Drohne | 3:2fbb2f0e79fb | 22 | //////////////////// |
nimaaghli | 4:46b52a6a943b | 23 | #define LED_MAX 1// // switch the value for your number of pixels |
Drohne | 3:2fbb2f0e79fb | 24 | //////////////////// |
Drohne | 3:2fbb2f0e79fb | 25 | #define middle 29// // define the mid of the pixels: to make it work middle-1 |
Drohne | 3:2fbb2f0e79fb | 26 | /////////////////// |
Drohne | 3:2fbb2f0e79fb | 27 | |
Drohne | 2:ccf3f0c36dae | 28 | #define OFF_DELAY 0.001 |
Drohne | 2:ccf3f0c36dae | 29 | |
Drohne | 2:ccf3f0c36dae | 30 | // define a cleary blue light |
Drohne | 2:ccf3f0c36dae | 31 | #define Green 100 |
Drohne | 2:ccf3f0c36dae | 32 | #define Red 255 |
Drohne | 2:ccf3f0c36dae | 33 | #define Blue 125 |
Drohne | 0:c6a6fa47dadc | 34 | |
Drohne | 3:2fbb2f0e79fb | 35 | void sendColours(int pos, uint8_t r, uint8_t g, uint8_t b); |