root / branches / autonomous_recharging / code / projects / libdragonfly / lights.h @ 833
History | View | Annotate | Download (2.91 KB)
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 |
|