The localization library for SCRIBE

Dependents:   SCRIBE_stepper

Committer:
nibab
Date:
Mon Apr 25 01:04:51 2016 +0000
Revision:
8:91db52943f3e
Parent:
6:ee872bf49be6
Automatically turn to the original position and measure. #define MMPERSTEP 17.

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 8:91db52943f3e 4 #include "stepper.h"
nibab 8:91db52943f3e 5 #define MMPERSTEP 17
nibab 0:a5cac0a5e41d 6
nibab 3:c749f7b2e12c 7 //#define VERTICAL // define it on the vertical version to compile the corresponding code
nibab 0:a5cac0a5e41d 8
nibab 0:a5cac0a5e41d 9 class localization
nibab 0:a5cac0a5e41d 10 {
nibab 0:a5cac0a5e41d 11 public:
nibab 0:a5cac0a5e41d 12 /**iniates the class with the specified trigger pin, echo pin, update speed and timeout**/
nibab 0:a5cac0a5e41d 13 localization();
nibab 0:a5cac0a5e41d 14 void reset(void); // reset, used at startup
nibab 0:a5cac0a5e41d 15 /**starts mesuring the distance**/
nibab 0:a5cac0a5e41d 16 void measure(void); // measure the current position and update X and Y
nibab 1:2cd9602780f4 17 float getAngle(void); //return the angle
nibab 6:ee872bf49be6 18 void servo(int degree);
nibab 0:a5cac0a5e41d 19 int getX(void); // return X
nibab 0:a5cac0a5e41d 20 int getY(void); // return Y
nibab 0:a5cac0a5e41d 21 private:
nibab 0:a5cac0a5e41d 22 int X;
nibab 0:a5cac0a5e41d 23 int Y;
nibab 0:a5cac0a5e41d 24 };