![](/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@14:82248fb06e53, 2016-05-12 (annotated)
- Committer:
- manz
- Date:
- Thu May 12 06:17:49 2016 +0000
- Revision:
- 14:82248fb06e53
- Parent:
- 11:59a95866416e
latest version;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
manz | 11:59a95866416e | 1 | #include "mbed.h" |
manz | 11:59a95866416e | 2 | #include "ultrasonic.h" |
manz | 11:59a95866416e | 3 | #include "BNO055.h" |
manz | 11:59a95866416e | 4 | #include "stepper.h" |
manz | 11:59a95866416e | 5 | #define MMPERSTEP 17 |
manz | 11:59a95866416e | 6 | |
manz | 11:59a95866416e | 7 | #define VERTICAL // define it on the vertical version to compile the corresponding code |
manz | 11:59a95866416e | 8 | |
manz | 11:59a95866416e | 9 | class localization |
manz | 11:59a95866416e | 10 | { |
manz | 11:59a95866416e | 11 | public: |
manz | 11:59a95866416e | 12 | /**iniates the class with the specified trigger pin, echo pin, update speed and timeout**/ |
manz | 11:59a95866416e | 13 | localization(); |
manz | 11:59a95866416e | 14 | void reset(void); // reset, used at startup |
manz | 11:59a95866416e | 15 | /**starts mesuring the distance**/ |
manz | 11:59a95866416e | 16 | void measure(void); // measure the current position and update X and Y |
manz | 11:59a95866416e | 17 | float getAngle(void); //return the angle |
manz | 11:59a95866416e | 18 | void servo(int degree); |
manz | 11:59a95866416e | 19 | int getX(void); // return X |
manz | 11:59a95866416e | 20 | int getY(void); // return Y |
manz | 11:59a95866416e | 21 | private: |
manz | 11:59a95866416e | 22 | int X; |
manz | 11:59a95866416e | 23 | int Y; |
manz | 11:59a95866416e | 24 | }; |