for thww WS2811 RGB

Dependencies:   mbed

Fork of WS2811 by Bulme Projekt

Committer:
Drohne
Date:
Fri Apr 29 07:46:25 2016 +0000
Revision:
2:ccf3f0c36dae
Parent:
1:165513b4e20a
Child:
3:2fbb2f0e79fb
diable interrrupt => speed up;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Drohne 0:c6a6fa47dadc 1 /*
Drohne 0:c6a6fa47dadc 2 * Creator: Matthias Hemmer
Drohne 0:c6a6fa47dadc 3 * created: 15.04.2016
Drohne 0:c6a6fa47dadc 4 * Board: Himbed v.2 Bulme
Drohne 0:c6a6fa47dadc 5 * Processor: Cortex M0
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
Drohne 0:c6a6fa47dadc 15 */#include "mbed.h"
Drohne 0:c6a6fa47dadc 16
Drohne 0:c6a6fa47dadc 17 #define HIGH_SIGNAL 4 // Logic 1
Drohne 0:c6a6fa47dadc 18 #define LOW_SIGNAL 1 // Logic 0
Drohne 2:ccf3f0c36dae 19 #define DELAY 0.000000000001
Drohne 2:ccf3f0c36dae 20 #define LED_MAX 57 // define the RGBs you have
Drohne 2:ccf3f0c36dae 21 #define OFF_DELAY 0.001
Drohne 2:ccf3f0c36dae 22
Drohne 2:ccf3f0c36dae 23 // define a cleary blue light
Drohne 2:ccf3f0c36dae 24 #define Green 100
Drohne 2:ccf3f0c36dae 25 #define Red 255
Drohne 2:ccf3f0c36dae 26 #define Blue 125
Drohne 0:c6a6fa47dadc 27
Drohne 0:c6a6fa47dadc 28 void sendColours(int pos, uint8_t r, uint8_t g, uint8_t b);
Drohne 1:165513b4e20a 29 void clear();
Drohne 1:165513b4e20a 30 void runlight(float waittime);