asdf
Dependencies: L3GD20 LSM303DLHC mbed
Diff: Headers/Sensors.h
- Revision:
- 5:9e504a5a1f48
- Parent:
- 4:ecfe2115e9a4
- Child:
- 6:6e96e93689df
--- a/Headers/Sensors.h Thu Apr 03 17:34:00 2014 +0000 +++ b/Headers/Sensors.h Thu Apr 03 18:47:30 2014 +0000 @@ -25,6 +25,11 @@ bool wallleft = false; float cal_R =0, cal_L =0, cal_F =0; +float linearize(float sensor) +{ + return abs(log(1-sensor)); +} + bool wallFront() { @@ -32,11 +37,11 @@ } bool wallLeft() { - return abs(log(1-SenseL.read())) < 5; + return linearize(SenseL.read()) < 5.2; } bool wallRight() { - return abs(log(1-SenseR.read())) < 5; + return linearize(SenseR.read()) < 5.2; } void check_walls() {