-
Notifications
You must be signed in to change notification settings - Fork 5
/
BiColorLED.h
48 lines (41 loc) · 1.53 KB
/
BiColorLED.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
/* Simple Bicolor LED library for Arduino, v1.4
Copyright (C) 2014 Wolfgang Faust
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Email: [email protected]
*/
#ifndef BiColorLED_H
#define BiColorLED_H 1.4
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
class BiColorLED{
public:
BiColorLED(uint8_t ledPin1, uint8_t ledPin2);
void drive();
void setColor(uint8_t toColor);
void setColor(uint8_t toColor1, uint8_t toColor2);
void setColor2(uint8_t toColor) __attribute__ ((deprecated));
uint8_t getColor();
uint8_t getColor2();
void setBlinkSpeed(unsigned long toSpeed);
void setBlinkSpeed(unsigned long toSpeed1, unsigned long toSpeed2);
unsigned long getBlinkSpeed();
unsigned long getBlinkSpeed2();
private:
uint8_t color1, color2;
uint8_t pin1, pin2;
bool yellowRed, blinkOne;
unsigned long lastBlink, blinkSpeed1, blinkSpeed2;
};
#endif