Revision 1403
unit test created for buttons
trunk/code/projects/test/test_dio.c | ||
---|---|---|
1 |
#include <dragonfly_lib.h> |
|
2 |
|
|
3 |
int testdio(void) { |
|
4 |
|
|
5 |
//test waits |
|
6 |
orb_set_color(wHITE); |
|
7 |
delay_ms(1000); |
|
8 |
orb_Set_color(ORB_OFF); |
|
9 |
button1_wait(); |
|
10 |
orb_set_color(wHITE); |
|
11 |
delay_ms(1000); |
|
12 |
orb_Set_color(ORB_OFF); |
|
13 |
button2_wait(); |
|
14 |
|
|
15 |
//test clicks |
|
16 |
orb_set_color(wHITE); |
|
17 |
delay_ms(1000); |
|
18 |
orb_Set_color(ORB_OFF); |
|
19 |
while(!button1_click()){;} |
|
20 |
orb_set_color(wHITE); |
|
21 |
delay_ms(1000); |
|
22 |
orb_Set_color(ORB_OFF); |
|
23 |
while(!button2_click()){;} |
|
24 |
|
|
25 |
//test reads |
|
26 |
orb_set_color(wHITE); |
|
27 |
delay_ms(1000); |
|
28 |
orb_Set_color(ORB_OFF); |
|
29 |
while(!button1_read()){;} |
|
30 |
orb_set_color(wHITE); |
|
31 |
delay_ms(1000); |
|
32 |
orb_Set_color(ORB_OFF); |
|
33 |
while(!button2_read()){;} |
|
34 |
orb_set_color(wHITE); |
|
35 |
delay_ms(1000); |
|
36 |
orb_Set_color(ORB_OFF); |
|
37 |
while(1){:} |
|
38 |
return 0; |
|
39 |
} |
Also available in: Unified diff