The localization library for SCRIBE

Dependents:   SCRIBE_stepper

Committer:
nibab
Date:
Mon Apr 18 23:05:21 2016 +0000
Revision:
2:e9d692eea8de
Parent:
1:2cd9602780f4
Child:
3:c749f7b2e12c
Refine the measure() function after the introduction of the getAngle() function.

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 2:e9d692eea8de 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 };