Library for controlling LED strips or arrays based on the WS2801 3-Channel Constant Current LED Driver, like the SF 32LED/m addressable LED strip. Any two digital out capable pins can be used for clock & data. also includes a header that defines the standart HTML color names

Dependents:   ws2801_controller

ws2801.h

Committer:
wertyfrog
Date:
2011-06-14
Revision:
1:363dd100d793
Parent:
0:b964d673c7db
Child:
2:a147efe1f3a8

File content as of revision 1:363dd100d793:

#ifndef WS2801_H
#define WS2801_H

#include "mbed.h"
#include "ws2801.h"
#include "HTML_color.h"

class ws2801 
{
public:
    /** Create a new ws2801 object
    * 
    * More details about the function goes here
    * and here
    *
    * @param CKI clock pin
    * @param SDI data  pin
    * @param STRIP_LENGTH number of ws2801 IC's i strip or array
    * @param reset_delay delay in us to allow latching data
    * @returns nothing   
    */
    ws2801(PinName CKI, PinName SDI, int STRIP_LENGTH = 32, int reset_delay = 800);
    /** write RGB color data to strip or array
    * 
    * More details about the function goes here
    * and here
    *
    * @param strip_colors array of color data, size must be 24xSTRIP_LENGHT bits
    */
    void post(int *strip_colors);
    /** clears the array or strip (all off)
    * 
    * More details about the function goes here
    * and here
    *
    */    
    void clear(void);
    /** dimms the entire array
    * 
    * More details about the function goes here
    * and here
    *
    * @param level level in percent
    * @returns current level
    */
    int setlevel(int level=100);
    /** set reset/write delay
    * 
    * More details about the function goes here
    * and here
    *
    * @param delay delay in us
    * @returns delay in us
    */    
    int setdelay(int reset_delay=800);
  
private:  
    DigitalOut _CKI;
    DigitalOut _SDI;
    int _STRIP_LENGTH;
    int _level;
    int _reset_delay;
};

#endif