Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of SeeedShieldBot by
Revision 9:e7a86f43d5ad, committed 2015-08-20
- Comitter:
- omarrasheedk
- Date:
- Thu Aug 20 21:45:07 2015 +0000
- Parent:
- 8:9fd1722259a1
- Commit message:
- Selfdriving car;
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 Thu Jul 31 14:42:21 2014 +0000 +++ b/SeeedStudioShieldBot.cpp Thu Aug 20 21:45:07 2015 +0000 @@ -160,3 +160,9 @@ stopLeft(); stopRight(); } + +int* SeeedStudioShieldBot::get_IR() +{ + int sensors[5] = {rightSensor.read(), inRightSensor.read(), centreSensor.read(), inLeftSensor.read(), leftSensor.read()}; + return sensors; +} \ No newline at end of file
--- a/SeeedStudioShieldBot.h Thu Jul 31 14:42:21 2014 +0000 +++ b/SeeedStudioShieldBot.h Thu Aug 20 21:45:07 2015 +0000 @@ -103,6 +103,11 @@ */ float line_position(); + /** Returns the values read by the sensors from Right to Left + * @return array of int giving the values read by the IR sensors + */ + int* get_IR(); + DigitalIn rightSensor; DigitalIn inRightSensor; DigitalIn centreSensor;