Revision 1280
Implemented ibom_set and ibom_read functions.
trunk/code/projects/diagnostic_station/station/hardware_ibom.c | ||
---|---|---|
10 | 10 |
if (on) |
11 | 11 |
{ |
12 | 12 |
usb_puts ("# Turning IBOM light on" NL); |
13 |
// FIXME implement
|
|
13 |
digital_output(IBOM_EMITTER_PIN, 1);
|
|
14 | 14 |
} |
15 | 15 |
else |
16 | 16 |
{ |
17 | 17 |
usb_puts ("# Turning IBOM light off" NL); |
18 |
// FIXME implement
|
|
18 |
digital_output(IBOM_EMITTER_PIN, 0);
|
|
19 | 19 |
} |
20 | 20 |
} |
21 | 21 |
|
22 | 22 |
void ibom_read (uint16_t *top, uint16_t *left, uint16_t *right) |
23 | 23 |
{ |
24 |
// FIXME implement |
|
25 |
|
|
26 |
*top=0; |
|
27 |
*left=0; |
|
28 |
*right=0; |
|
24 |
*top =analog10(IBOM_SENSOR_TOP); |
|
25 |
*left =analog10(IBOM_SENSOR_LEFT); |
|
26 |
*right =analog10(IBOM_SENSOR_RIGHT); |
|
29 | 27 |
} |
30 | 28 |
|
31 | 29 |
void ibom_update (void) |
trunk/code/projects/diagnostic_station/station/hardware_ibom.h | ||
---|---|---|
5 | 5 |
#include "global.h" |
6 | 6 |
|
7 | 7 |
/* |
8 |
* Inverse BOM sensor macros for (N)orth, |
|
9 |
* (S)outh, (E)ast, and (W)est positions. |
|
8 |
* Inverse BOM sensor macros for left, right, and top positions. |
|
10 | 9 |
*/ |
11 | 10 |
// FIXME do it right |
12 | 11 |
#define IBOM_SENSOR_LEFT AN3 |
... | ... | |
14 | 13 |
#define IBOM_SENSOR_TOP AN5 |
15 | 14 |
//#define IBOM_SENSOR_ AN6 |
16 | 15 |
|
16 |
#define IBOM_EMITTER_PIN PIN_A5 |
|
17 |
|
|
17 | 18 |
void ibom_init (void); |
18 | 19 |
|
19 | 20 |
void ibom_set (bool on); |
trunk/code/projects/diagnostic_station/station/README | ||
---|---|---|
6 | 6 |
dragonfly board controlling the station hardware. The station runs |
7 | 7 |
the tests and communicates with the server and the robot. |
8 | 8 |
|
9 |
COMPILE NOTES: |
|
10 |
To compile, call |
|
11 |
|
|
12 |
make -f <your Makefile> [-program] |
|
13 |
|
|
14 |
This is implemented to allow the development of several different |
|
15 |
main functions simultaneously. |
|
16 |
|
trunk/code/projects/diagnostic_station/station/main.c | ||
---|---|---|
65 | 65 |
|
66 | 66 |
int main_john (void) |
67 | 67 |
{ |
68 |
dragonfly_init(0); |
|
69 |
orb_init(); |
|
70 |
usb_init(); |
|
71 |
analog_init(ADC_START); |
|
68 |
dragonfly_init(0); |
|
72 | 69 |
|
73 |
orbs_set(255, 0,255,255,0,255); |
|
70 |
// Initialize before using USB |
|
71 |
comm_server_init (); |
|
74 | 72 |
|
73 |
usb_puts(NL NL NL); |
|
74 |
usb_puts("# Diagnostic station version " version_string " starting" NL); |
|
75 | 75 |
|
76 |
orb_init_pwm (); |
|
77 |
hardware_init (); |
|
78 |
|
|
79 |
orb1_set (255, 0, 0); usb_puts("# Initializing wireless" NL); |
|
80 |
comm_robot_init (); |
|
81 |
orb2_set (255, 0, 0); usb_puts("# Done" NL); |
|
82 |
|
|
83 |
interactive_main (); |
|
84 |
|
|
85 |
while (1); |
|
76 | 86 |
return 0; |
77 | 87 |
} |
78 | 88 |
|
Also available in: Unified diff