Autonomous line tracking with bump sensor
Fork of SeeedShieldBot by
Diff: SeeedStudioShieldBot.cpp
- Revision:
- 1:5c40f2a5e1ac
- Parent:
- 0:227158f56a11
- Child:
- 2:118efce95f3c
--- a/SeeedStudioShieldBot.cpp Mon Jul 15 13:16:09 2013 +0000 +++ b/SeeedStudioShieldBot.cpp Mon Jul 15 13:38:07 2013 +0000 @@ -99,19 +99,19 @@ // Give a value representative of the overall data received by the sensors... // Output between +1 and -1. // Positive is right, negative left... -float SeeedStudioShieldBot::get_sensors_overall_value() { +float SeeedStudioShieldBot::line_position() { float output = 0; if (rightSensor == 1) { output += 0.5; } if (inRightSensor == 1) { - output += 0.25; + output += 0.5; } if (leftSensor == 1) { output -= 0.5; } if (inLeftSensor == 1) { - output -= 0.25; + output -= 0.5; } return output;