A library for SPI control of adafruit's neopixel ring and addressable LEDs.

Dependencies:   PixelArray

Dependents:   TI_NEOPIXEL_SPI_SAMPLE

TI_NEOPIXEL_SPI.h

Committer:
tichise
Date:
13 months ago
Revision:
3:f0859c280204
Parent:
2:0148ac5c90fa
Child:
4:70bc3528e07e

File content as of revision 3:f0859c280204:

#ifndef MBED_TI_NEOPIXEL_SPI_H
#define MBED_TI_NEOPIXEL_SPI_H

#include "mbed.h"
#include "neopixel.h"

typedef struct rgbColor
{
  uint8_t red;
  uint8_t green;
  uint8_t blue;
} rgbColor;

class TI_NEOPIXEL_SPI
{
public:
  TI_NEOPIXEL_SPI(PinName input);

  void switchLightOff(int count);
  void switchLightOn(int count, int startCount, int endCount, rgbColor rgbColor);

  void changeColor(int count, int startCount, int endCount, rgbColor rgbColor);
  void changePointColor(int count, int topIndex, int endIndex, rgbColor topColor, rgbColor bottomColor);

  void circle(int count, int startCount, int endCount, rgbColor rgbColor);
  void chase(int count, int bufferCount, rgbColor c1, rgbColor c2);
  void chaseRainbow(int count);
  void circleRainbow(int count);
  rgbColor convertHsvToRgb(float h, float s, float v);

private:
  NeoPixelOut _neoPixel;
};

#endif