Class available to make using NeoPixel lights very simple

Dependencies:   PixelArray

Dependents:   NeoPixelEasy

Committer:
dannellyz
Date:
Sun Feb 15 21:24:57 2015 +0000
Revision:
4:3a9cfb1ab658
Parent:
3:fb34ddc9441f
Child:
5:f9b8a3a241b1
more comments

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dannellyz 4:3a9cfb1ab658 1 /*!
dannellyz 0:cfbe334f4b1c 2 Class to use the NeoPixels on an mbed with ease
dannellyz 0:cfbe334f4b1c 3 */
dannellyz 0:cfbe334f4b1c 4 #include "mbed.h"
dannellyz 0:cfbe334f4b1c 5 #include "neopixel.h"
dannellyz 0:cfbe334f4b1c 6
dannellyz 1:f401535caf70 7 /** Interface to work with Adafruit NeoPixel lights */
dannellyz 0:cfbe334f4b1c 8 class easyNeo
dannellyz 0:cfbe334f4b1c 9 {
dannellyz 0:cfbe334f4b1c 10 private:
dannellyz 0:cfbe334f4b1c 11 int numLeds;
dannellyz 0:cfbe334f4b1c 12 public:
dannellyz 1:f401535caf70 13 /**Configure simple with the number of lights in the series*/
dannellyz 0:cfbe334f4b1c 14 easyNeo(int numLeds);
dannellyz 0:cfbe334f4b1c 15
dannellyz 3:fb34ddc9441f 16
dannellyz 0:cfbe334f4b1c 17 void setPixel(neopixel::Pixel * buffer, uint32_t, uint8_t, uint8_t, uint8_t, uint32_t);
dannellyz 0:cfbe334f4b1c 18
dannellyz 0:cfbe334f4b1c 19 void lightTest();
dannellyz 3:fb34ddc9441f 20
dannellyz 0:cfbe334f4b1c 21 void setByColor(int ledNum, char* color);
dannellyz 3:fb34ddc9441f 22 /** Set the colors of the lights with a continuous hex string
dannellyz 3:fb34ddc9441f 23 String should have 6 hex characters for each light corresponding
dannellyz 3:fb34ddc9441f 24 to their R,G and then B vlues you wish to set.
dannellyz 3:fb34ddc9441f 25 * @param hexString above mentioned string.
dannellyz 3:fb34ddc9441f 26 */
dannellyz 0:cfbe334f4b1c 27 void setByHex(char*);
dannellyz 0:cfbe334f4b1c 28
dannellyz 0:cfbe334f4b1c 29 void clear();
dannellyz 0:cfbe334f4b1c 30
dannellyz 0:cfbe334f4b1c 31 void update(neopixel::Pixel * buffer);
dannellyz 0:cfbe334f4b1c 32
dannellyz 0:cfbe334f4b1c 33 uint8_t c2i(char );
dannellyz 0:cfbe334f4b1c 34 };