-
Notifications
You must be signed in to change notification settings - Fork 0
/
LED.h
executable file
·57 lines (50 loc) · 1.1 KB
/
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
54
55
56
57
/*
||
|| @file LED.h
|| @version 1.1
|| @author Alexander Brevig
|| @contact [email protected]
||
|| @description
|| | Provide an easy way of making/using LEDs
|| #
||
|| @license
|| | Copyright (c) 2009 Alexander Brevig. All rights reserved.
|| | This code is subject to AlphaLicence.txt
|| | alphabeta.alexanderbrevig.com/AlphaLicense.txt
|| #
||
*/
#ifndef LED_H
#define LED_H
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
class LED {
public:
LED(uint8_t ledPin);
bool getState();
void on();
void off();
void toggle();
void blink(unsigned int time, byte times = 1);
void setValue(byte val);
void fadeIn(unsigned int time);
void fadeOut(unsigned int time);
private:
bool status;
uint8_t pin;
};
extern LED DEBUG_LED;
#endif
/*
|| @changelog
|| | 1.1 2009-05-07 - Alexander Brevig : Added blink(uint,byte), requested by:
Josiah Ritchie - [email protected]
|| | 1.1 2009-04-07 - Alexander Brevig : Altered API
|| | 1.0 2009-04-17 - Alexander Brevig : Initial Release
|| #
*/