-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLed.h
53 lines (39 loc) · 767 Bytes
/
Led.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* Led.h
*
* Created on: May 5, 2016
* Author: Adam
*/
#ifndef LED_H_
#define LED_H_
#include "Arduino.h"
#include "Arduino_FreeRTOS.h"
#include "queue.h"
//#define LED_R 3 // ATMega328P pin 5
//#define LED_G 5 // ATMega328P pin 11
//#define LED_B 6 // ATMega328P pin 12
struct LedMsg {
byte r;
byte g;
byte b;
long duration;
};
class Led {
public:
// Holds LedMsgs
QueueHandle_t ledMsgQueue;
Led(QueueHandle_t);
/**
* Loop function that the LED task is registered with. Never exits. Takes no params.
*/
void taskFunc();
/**
* Gamma-corrects the given color and writes it out to the LED.
*/
void writeColor(byte r, byte g, byte b);
/**
* Glue for FreeRTOS.
*/
static void cast(void *params);
};
#endif /* LED_H_ */