Revision 241
Updated libdragonfly documentation.
lights.h | ||
---|---|---|
1 |
/** |
|
2 |
* @file lights.h |
|
3 |
* @brief Contains declarations for managing the orbs. |
|
4 |
* |
|
5 |
* Contains declarations for using the orbs and PWM. |
|
6 |
* |
|
7 |
* @author Colony Project, CMU Robotics Club |
|
8 |
* Based on Firefly Library, by Tom Lauwers and Steven Shamlian |
|
9 |
**/ |
|
10 |
|
|
11 |
#ifndef _LIGHTS_H_ |
|
12 |
#define _LIGHTS_H_ |
|
13 |
|
|
14 |
|
|
15 |
/** |
|
16 |
* @addtogroup orbs |
|
17 |
* @{ |
|
18 |
**/ |
|
19 |
|
|
20 |
//ORB Colors |
|
21 |
/** @brief Red **/ |
|
22 |
#define RED 0xE0 |
|
23 |
/** @brief Orange **/ |
|
24 |
#define ORANGE 0xE4 |
|
25 |
/** @brief Yellow **/ |
|
26 |
#define YELLOW 0xE8 |
|
27 |
/** @brief Lime **/ |
|
28 |
#define LIME 0x68 |
|
29 |
/** @brief Green **/ |
|
30 |
#define GREEN 0x1C |
|
31 |
/** @brief Cyan **/ |
|
32 |
#define CYAN 0x1F |
|
33 |
/** @brief Blue **/ |
|
34 |
#define BLUE 0x03 |
|
35 |
/** @brief Pink **/ |
|
36 |
#define PINK 0xA6 |
|
37 |
/** @brief Purple **/ |
|
38 |
#define PURPLE 0x41 |
|
39 |
/** @brief Magenta **/ |
|
40 |
#define MAGENTA 0xE3 |
|
41 |
/** @brief White **/ |
|
42 |
#define WHITE 0xFE |
|
43 |
/** @brief Turn the orb off (White) **/ |
|
44 |
#define ORB_OFF 0xFE //ORB_OFF->WHITE |
|
45 |
|
|
46 |
/** @brief Enables the orbs **/ |
|
47 |
void orb_init(void); |
|
48 |
/** @brief Set both orbs to a specified color **/ |
|
49 |
void orb_set(unsigned char red_led, unsigned char green_led, |
|
50 |
unsigned char blue_led); |
|
51 |
/** @brief Set orb1 to a specified color **/ |
|
52 |
void orb1_set(unsigned char red_led, unsigned char green_led, |
|
53 |
unsigned char blue_led); |
|
54 |
/** @brief Set orb2 to a specified color **/ |
|
55 |
void orb2_set(unsigned char red_led, unsigned char green_led, |
|
56 |
unsigned char blue_led); |
|
57 |
|
|
58 |
/** @brief Set both orbs to a specified color **/ |
|
59 |
void orb_set_color(int col); |
|
60 |
/** @brief Set orb1 to a specified color **/ |
|
61 |
void orb1_set_color(int col); |
|
62 |
/** @brief Set orb2 to a specified color **/ |
|
63 |
void orb2_set_color(int col); |
|
64 |
|
|
65 |
/** @brief Disable the orbs **/ |
|
66 |
void orb_disable(void); |
|
67 |
/** @brief Enable the orbs **/ |
|
68 |
void orb_enable(void); |
|
69 |
|
|
70 |
/** @} **/ //end addtogroup |
|
71 |
|
|
72 |
#endif |
|
1 |
/** |
|
2 |
* Copyright (c) 2007 Colony Project |
|
3 |
* |
|
4 |
* Permission is hereby granted, free of charge, to any person |
|
5 |
* obtaining a copy of this software and associated documentation |
|
6 |
* files (the "Software"), to deal in the Software without |
|
7 |
* restriction, including without limitation the rights to use, |
|
8 |
* copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
9 |
* copies of the Software, and to permit persons to whom the |
|
10 |
* Software is furnished to do so, subject to the following |
|
11 |
* conditions: |
|
12 |
* |
|
13 |
* The above copyright notice and this permission notice shall be |
|
14 |
* included in all copies or substantial portions of the Software. |
|
15 |
* |
|
16 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
17 |
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
18 |
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
19 |
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
20 |
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
21 |
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
22 |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
23 |
* OTHER DEALINGS IN THE SOFTWARE. |
|
24 |
**/ |
|
25 |
|
|
26 |
|
|
27 |
/** |
|
28 |
* @file lights.h |
|
29 |
* @brief Contains declarations for managing the orbs. |
|
30 |
* |
|
31 |
* Contains declarations for using the orbs and PWM. |
|
32 |
* |
|
33 |
* @author Colony Project, CMU Robotics Club |
|
34 |
* Based on Firefly Library, by Tom Lauwers and Steven Shamlian |
|
35 |
**/ |
|
36 |
|
|
37 |
#ifndef _LIGHTS_H_ |
|
38 |
#define _LIGHTS_H_ |
|
39 |
|
|
40 |
|
|
41 |
/** |
|
42 |
* @addtogroup orbs |
|
43 |
* @{ |
|
44 |
**/ |
|
45 |
|
|
46 |
//ORB Colors |
|
47 |
/** @brief Red **/ |
|
48 |
#define RED 0xE0 |
|
49 |
/** @brief Orange **/ |
|
50 |
#define ORANGE 0xE4 |
|
51 |
/** @brief Yellow **/ |
|
52 |
#define YELLOW 0xE8 |
|
53 |
/** @brief Lime **/ |
|
54 |
#define LIME 0x68 |
|
55 |
/** @brief Green **/ |
|
56 |
#define GREEN 0x1C |
|
57 |
/** @brief Cyan **/ |
|
58 |
#define CYAN 0x1F |
|
59 |
/** @brief Blue **/ |
|
60 |
#define BLUE 0x03 |
|
61 |
/** @brief Pink **/ |
|
62 |
#define PINK 0xA6 |
|
63 |
/** @brief Purple **/ |
|
64 |
#define PURPLE 0x41 |
|
65 |
/** @brief Magenta **/ |
|
66 |
#define MAGENTA 0xE3 |
|
67 |
/** @brief White **/ |
|
68 |
#define WHITE 0xFE |
|
69 |
/** @brief Turn the orb off (White) **/ |
|
70 |
#define ORB_OFF 0xFE //ORB_OFF->WHITE |
|
71 |
|
|
72 |
/** @brief Enables the orbs **/ |
|
73 |
void orb_init(void); |
|
74 |
/** @brief Set both orbs to a specified color **/ |
|
75 |
void orb_set(unsigned char red_led, unsigned char green_led, |
|
76 |
unsigned char blue_led); |
|
77 |
/** @brief Set orb1 to a specified color **/ |
|
78 |
void orb1_set(unsigned char red_led, unsigned char green_led, |
|
79 |
unsigned char blue_led); |
|
80 |
/** @brief Set orb2 to a specified color **/ |
|
81 |
void orb2_set(unsigned char red_led, unsigned char green_led, |
|
82 |
unsigned char blue_led); |
|
83 |
|
|
84 |
/** @brief Set both orbs to a specified color **/ |
|
85 |
void orb_set_color(int col); |
|
86 |
/** @brief Set orb1 to a specified color **/ |
|
87 |
void orb1_set_color(int col); |
|
88 |
/** @brief Set orb2 to a specified color **/ |
|
89 |
void orb2_set_color(int col); |
|
90 |
|
|
91 |
/** @brief Disable the orbs **/ |
|
92 |
void orb_disable(void); |
|
93 |
/** @brief Enable the orbs **/ |
|
94 |
void orb_enable(void); |
|
95 |
|
|
96 |
/** @} **/ //end addtogroup |
|
97 |
|
|
98 |
#endif |
|
99 |
|
Also available in: Unified diff