The localization library for SCRIBE

Dependents:   SCRIBE_stepper

Committer:
nibab
Date:
Mon Apr 18 22:46:58 2016 +0000
Revision:
1:2cd9602780f4
Parent:
0:a5cac0a5e41d
Child:
2:e9d692eea8de
Add the getAngle() function to retrieve the angle directly.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nibab 0:a5cac0a5e41d 1 #include "mbed.h"
nibab 0:a5cac0a5e41d 2 #include "ultrasonic.h"
nibab 0:a5cac0a5e41d 3 #include "BNO055.h"
nibab 0:a5cac0a5e41d 4
nibab 1:2cd9602780f4 5 //#define VERTICAL // define it on the vertical version to compile the corresponding code
nibab 0:a5cac0a5e41d 6
nibab 0:a5cac0a5e41d 7 class localization
nibab 0:a5cac0a5e41d 8 {
nibab 0:a5cac0a5e41d 9 public:
nibab 0:a5cac0a5e41d 10 /**iniates the class with the specified trigger pin, echo pin, update speed and timeout**/
nibab 0:a5cac0a5e41d 11 localization();
nibab 0:a5cac0a5e41d 12 void reset(void); // reset, used at startup
nibab 0:a5cac0a5e41d 13 /**starts mesuring the distance**/
nibab 0:a5cac0a5e41d 14 void measure(void); // measure the current position and update X and Y
nibab 1:2cd9602780f4 15 float getAngle(void); //return the angle
nibab 0:a5cac0a5e41d 16 int getX(void); // return X
nibab 0:a5cac0a5e41d 17 int getY(void); // return Y
nibab 0:a5cac0a5e41d 18 private:
nibab 0:a5cac0a5e41d 19 int X;
nibab 0:a5cac0a5e41d 20 int Y;
nibab 0:a5cac0a5e41d 21 };