Library for the Shield Bot by SeeedStudio
Dependents: Seeed_Bot_Shield Seeed_BlueBot_demo Seeed_BlueBot_demo_test1 LAB03_Oppgav1 ... more
Fork of SeeedShieldBot by
Revision 1:5c40f2a5e1ac, committed 2013-07-15
- Comitter:
- melse
- Date:
- Mon Jul 15 13:38:07 2013 +0000
- Parent:
- 0:227158f56a11
- Child:
- 2:118efce95f3c
- Commit message:
- Made the library more compatible with the m3pi lib
Changed in this revision
SeeedStudioShieldBot.cpp | Show annotated file Show diff for this revision Revisions of this file |
SeeedStudioShieldBot.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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;
--- a/SeeedStudioShieldBot.h Mon Jul 15 13:16:09 2013 +0000 +++ b/SeeedStudioShieldBot.h Mon Jul 15 13:38:07 2013 +0000 @@ -28,7 +28,7 @@ // Need to do something to do with detected line... - float get_sensors_overall_value(); + float line_position(); DigitalIn rightSensor; DigitalIn inRightSensor;