Revision 1159
Added robot code
Added robot/station communication
main.c | ||
---|---|---|
1 | 1 |
#include <dragonfly_lib.h> |
2 |
#include <wireless.h> |
|
3 |
#include <xbee.h> |
|
2 | 4 |
|
5 |
#include "../common/comm_station_robot.h" |
|
6 |
|
|
3 | 7 |
#include "global.h" |
4 | 8 |
#include "station_hardware.h" |
5 | 9 |
|
6 | 10 |
#include "test_comm.h" |
7 | 11 |
#include "test_bom.h" |
8 | 12 |
#include "test_rangefinders.h" |
13 |
#include "test_motors.h" |
|
9 | 14 |
#include "test_encoders.h" |
10 |
#include "test_motors.h" |
|
11 | 15 |
|
12 | 16 |
bool communication_ok=false; |
13 | 17 |
|
... | ... | |
47 | 51 |
|
48 | 52 |
usb_puts (NL); |
49 | 53 |
usb_puts ("Diagnostic station interactive mode" NL); |
50 |
usb_puts ("Test (s)elf, (a)ll, (c)omm, (b)om, (r)angefinders, (e)ncoders, (m)otors" NL);
|
|
54 |
usb_puts ("Test (s)elf, (a)ll, (c)omm, (b)om, (r)angefinders, (m)otors, (e)ncoders" NL);
|
|
51 | 55 |
|
52 | 56 |
char choice = usb_getc (); |
53 | 57 |
switch (choice) { |
... | ... | |
55 | 59 |
case 'a': case 'A': test_all (); break; // test_all will test comm itself |
56 | 60 |
case 'b': case 'B': if (require_comm ()) test_bom (true, true); break; |
57 | 61 |
case 'r': case 'R': if (require_comm ()) test_rangefinders (); break; |
62 |
case 'm': case 'M': if (require_comm ()) test_motors (); break; |
|
58 | 63 |
case 'e': case 'E': if (require_comm ()) test_encoders (); break; |
59 |
case 'm': case 'M': if (require_comm ()) test_motors (); break; |
|
60 | 64 |
case 's': case 'S': self_test (); break; |
61 | 65 |
default: break; // ignore it |
62 | 66 |
// usb_puts("Received invalid input "); |
... | ... | |
79 | 83 |
#include <dragonfly_lib.h> |
80 | 84 |
#include <wireless.h> |
81 | 85 |
|
82 |
// dragonfly_init(ALL_ON); |
|
83 |
// wl_init(); |
|
84 |
// |
|
85 |
// while (1) |
|
86 |
// { |
|
87 |
// wl_do(); |
|
88 |
// do_stuff(); |
|
89 |
// } |
|
90 |
// return 0; |
|
86 |
dragonfly_init(0); |
|
91 | 87 |
|
92 |
dragonfly_init(0); |
|
93 |
usb_init (); |
|
94 |
orb_init (); |
|
88 |
usb_init (); |
|
95 | 89 |
|
96 | 90 |
usb_puts(NL NL NL); |
97 | 91 |
usb_puts("Diagnostic station version " version_string " starting" NL); |
92 |
|
|
93 |
orb_init_pwm (); |
|
98 | 94 |
hardware_init (); |
99 |
|
|
95 |
|
|
96 |
orb1_set (255, 0, 0); usb_puts("Initializing wireless" NL); |
|
97 |
xbee_init (); |
|
98 |
wl_init(); |
|
99 |
orb2_set (255, 0, 0); usb_puts("Done" NL); |
|
100 |
|
|
100 | 101 |
if (button2_read ()) |
101 | 102 |
server_main (); |
102 | 103 |
else |
Also available in: Unified diff