asdf

Dependencies:   L3GD20 LSM303DLHC mbed

Committer:
goy5022
Date:
Thu Apr 03 13:15:40 2014 +0000
Revision:
2:997f57aee3b7
Parent:
1:cfe6a6ad8dca
Child:
3:1a8a7cc709cc
Gal last touched this inappropriately

Who changed what in which revision?

UserRevisionLine numberNew contents of line
goy5022 0:c2ec30f28676 1 #ifndef SENSORS_H
goy5022 0:c2ec30f28676 2 #define SENSORS_H
goy5022 0:c2ec30f28676 3
goy5022 2:997f57aee3b7 4 //#include "Core.h"
goy5022 2:997f57aee3b7 5
goy5022 2:997f57aee3b7 6 #include "ExponentialAverage.h"
goy5022 0:c2ec30f28676 7 #include "L3GD20.h"
goy5022 0:c2ec30f28676 8 #include "LSM303DLHC.h"
goy5022 0:c2ec30f28676 9
goy5022 2:997f57aee3b7 10
goy5022 2:997f57aee3b7 11 float ax, ay, az;
goy5022 2:997f57aee3b7 12 float mx, my, mz;
goy5022 2:997f57aee3b7 13 float gx, gy, gz;
goy5022 2:997f57aee3b7 14
goy5022 0:c2ec30f28676 15 L3GD20 gyro(p9, p10);
goy5022 0:c2ec30f28676 16 LSM303DLHC compass(p9, p10);
goy5022 1:cfe6a6ad8dca 17 PwmOut ledF(p23);
goy5022 1:cfe6a6ad8dca 18 PwmOut ledR(p21);
goy5022 1:cfe6a6ad8dca 19 PwmOut ledL(p22);
goy5022 1:cfe6a6ad8dca 20 AnalogIn SenseR(p15);
goy5022 1:cfe6a6ad8dca 21 AnalogIn SenseL(p16);
goy5022 1:cfe6a6ad8dca 22 AnalogIn SenseF(p17);
goy5022 0:c2ec30f28676 23
goy5022 2:997f57aee3b7 24
goy5022 2:997f57aee3b7 25
goy5022 2:997f57aee3b7 26 bool wallFront()
goy5022 2:997f57aee3b7 27 {
goy5022 2:997f57aee3b7 28 return frontExpAvg.average() > .90;
goy5022 2:997f57aee3b7 29 }
goy5022 2:997f57aee3b7 30 bool wallLeft()
goy5022 1:cfe6a6ad8dca 31 {
goy5022 2:997f57aee3b7 32 return SenseL.read() > .94;
goy5022 1:cfe6a6ad8dca 33 }
goy5022 2:997f57aee3b7 34 bool wallRight()
goy5022 2:997f57aee3b7 35 {
goy5022 2:997f57aee3b7 36 return SenseR.read() > .94;
goy5022 2:997f57aee3b7 37 }
goy5022 0:c2ec30f28676 38 #endif