LRT13  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
LEDIndicators.h
1 #ifndef LED_INDICATORS_H_
2 #define LED_INDICATORS_H_
3 /*
4  * LED Indicator code based off of reference implementation found here:
5  * https://github.com/adafruit/LPD8806
6  */
7 #include <SPI.h>
8 
9 #include "../ComponentData/ComponentData.h"
10 #include "../ComponentData/LEDIndicatorData.h"
11 
12 #include "../Process/SynchronizedProcess.h"
13 #include "../Config/RobotConfig.h"
14 
15 #define NUMLEDS 16
16 using namespace data;
17 using namespace data::indicators;
18 
19 class LEDIndicators : public SynchronizedProcess
20 {
21 public:
22  LEDIndicators();
23  ~LEDIndicators();
24 
25  INT32 Tick();
26 private:
27  void setPixelColor(int numpixel, UINT32 grb);
28  void setPixelRangeColor(int startpixel, int endpixel, UINT32 grb);
29 
30  UINT8* m_pixelBuffer;
31 
32  DigitalOutput* m_clockOut;
33  DigitalOutput* m_dataOut;
34  SPI* m_spi;
35 
36  LEDIndicatorData* ledData;
37 };
38 #endif