Revision 1131
Cleaned up lights.h
Implemented predefined color setting
Implemented binary/PWM mode switching
main.c | ||
---|---|---|
3 | 3 |
|
4 | 4 |
// Martin "deffi" Herrmann Test |
5 | 5 |
|
6 |
static void oset(r,g,b)
|
|
6 |
static void oset(uint8_t r,uint8_t g,uint8_t b)
|
|
7 | 7 |
{ |
8 | 8 |
orbs_set(r,g,b,255-r,255-g,255-b); |
9 | 9 |
} |
10 | 10 |
|
11 |
static void color_circle () |
|
11 |
static void color_circle (void)
|
|
12 | 12 |
{ |
13 | 13 |
while(1) |
14 | 14 |
{ |
... | ... | |
50 | 50 |
} |
51 | 51 |
} |
52 | 52 |
|
53 |
static void acl() |
|
53 |
static void acl(void)
|
|
54 | 54 |
{ |
55 | 55 |
#define redval 255 |
56 | 56 |
#define greenval 150 |
... | ... | |
71 | 71 |
} |
72 | 72 |
} |
73 | 73 |
|
74 |
|
|
75 | 74 |
int main(void) { |
76 | 75 |
// dragonfly_init(ALL_ON); |
77 | 76 |
dragonfly_init(0); |
... | ... | |
79 | 78 |
usb_init (); |
80 | 79 |
usb_puts ("Startup\r\n"); |
81 | 80 |
|
82 |
|
|
81 |
|
|
83 | 82 |
//encoders_init (); |
84 | 83 |
|
85 | 84 |
//analog_init(ADC_START); |
... | ... | |
92 | 91 |
//motors_init (); |
93 | 92 |
//motor2_set (FORWARD, 64); |
94 | 93 |
|
95 |
orb_init (); |
|
94 |
//orb_init_binary (); |
|
95 |
orb_init_pwm (); |
|
96 | 96 |
|
97 | 97 |
if (false) |
98 | 98 |
{ |
99 |
orb_set (255, 0, 0); delay_ms (500); |
|
100 |
orb_set (0, 255, 0); delay_ms (500); |
|
101 |
orb_set (0, 0, 255); delay_ms (500); |
|
102 |
} |
|
103 |
|
|
104 |
if (false) |
|
105 |
{ |
|
106 | 99 |
orbs_set (255, 0, 0, 0, 0, 0); delay_ms (500); |
107 | 100 |
orbs_set (0, 255, 0, 0, 0, 0); delay_ms (500); |
108 | 101 |
orbs_set (0, 0, 255, 0, 0, 0); delay_ms (500); |
... | ... | |
115 | 108 |
{ |
116 | 109 |
if (!button2_read ()) |
117 | 110 |
{ |
111 |
orb_set_mode (orb_mode_pwm); |
|
118 | 112 |
orb_disable_timer (); |
119 | 113 |
|
120 | 114 |
while (1) |
Also available in: Unified diff