-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
68 lines (56 loc) · 1.24 KB
/
main.c
File metadata and controls
68 lines (56 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
robot control by chris
*/
#include "simpletools.h" // Include simple tools
#include "xbee.h"
#include "pixy/pixy.h"
#include "main.h"
#include "ping.h"
#include "DCmotor.h"
#include "LSM303.h"
#include "sensors.h"
/*
*pin0 M1 en
*pin1 M1 in1
*pin2 M1 in2
*pin3
*pin4 rng T
*pin5 rng E
*pin6 xbee CTS'
*pin7 xbee RTS'
*pin8 xbee di
*pin9 xbee do
*pin10 M2 en
*pin11 M2 in1
*pin12 M2 in2
*pin13 pxy in
*pin14 pxy out
*pin15 pxy clk
*/
int *pixy_cog;
int *lsm303_cog;
int *serial_start;
extern volatile lsm303AccelData accelData; // Last read accelerometer data will be available here
extern volatile lsm303MagData magData; // Last read magnetometer data will be available here
extern volatile uint16_t blockCount;
int main()
{
int running=1;
xbeeinit();
dprint(xbee,"\ninit...\n");
pixy_cog = cog_run(&pixyStart, 60);
lsm303_cog = cog_run(&lsm303_start, 30);
// serial_start = cog_run(&serialstart, 30);
//if(!lsm303_begin()){
// dprint(xbee,"accel init...failed\n"); ;
//}
dprint(xbee,"command: ");
while(running)
{
pause(500);
if( fdserial_rxReady(xbee) )sgets();
}
cog_end(pixy_cog);
cog_end(lsm303_cog);
print("done...\n");
}