![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
The servo version of SCRIBE
Dependencies: BLE_nRF8001 BNO055 HC_SR04_Ultrasonic_Library mbed-rtos mbed
Fork of SCRIBE_stepper by
localization.h@10:c58f3a00a9ba, 2016-05-05 (annotated)
- Committer:
- nibab
- Date:
- Thu May 05 21:55:28 2016 +0000
- Revision:
- 10:c58f3a00a9ba
Get rid of the localization library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nibab | 10:c58f3a00a9ba | 1 | #include "mbed.h" |
nibab | 10:c58f3a00a9ba | 2 | #include "ultrasonic.h" |
nibab | 10:c58f3a00a9ba | 3 | #include "BNO055.h" |
nibab | 10:c58f3a00a9ba | 4 | #include "stepper.h" |
nibab | 10:c58f3a00a9ba | 5 | #define MMPERSTEP 17 |
nibab | 10:c58f3a00a9ba | 6 | |
nibab | 10:c58f3a00a9ba | 7 | #define VERTICAL // define it on the vertical version to compile the corresponding code |
nibab | 10:c58f3a00a9ba | 8 | |
nibab | 10:c58f3a00a9ba | 9 | class localization |
nibab | 10:c58f3a00a9ba | 10 | { |
nibab | 10:c58f3a00a9ba | 11 | public: |
nibab | 10:c58f3a00a9ba | 12 | /**iniates the class with the specified trigger pin, echo pin, update speed and timeout**/ |
nibab | 10:c58f3a00a9ba | 13 | localization(); |
nibab | 10:c58f3a00a9ba | 14 | void reset(void); // reset, used at startup |
nibab | 10:c58f3a00a9ba | 15 | /**starts mesuring the distance**/ |
nibab | 10:c58f3a00a9ba | 16 | void measure(void); // measure the current position and update X and Y |
nibab | 10:c58f3a00a9ba | 17 | float getAngle(void); //return the angle |
nibab | 10:c58f3a00a9ba | 18 | void servo(int degree); |
nibab | 10:c58f3a00a9ba | 19 | int getX(void); // return X |
nibab | 10:c58f3a00a9ba | 20 | int getY(void); // return Y |
nibab | 10:c58f3a00a9ba | 21 | private: |
nibab | 10:c58f3a00a9ba | 22 | int X; |
nibab | 10:c58f3a00a9ba | 23 | int Y; |
nibab | 10:c58f3a00a9ba | 24 | }; |