Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: backdrive backdrive_3
Diff: encoder.h
- Revision:
- 3:6dce9d79da13
- Parent:
- 2:4bb7c8730d91
- Child:
- 4:c99eb511ac08
diff -r 4bb7c8730d91 -r 6dce9d79da13 encoder.h
--- a/encoder.h Sun Jul 22 00:15:08 2018 +0000
+++ b/encoder.h Tue Dec 04 09:42:15 2018 +0000
@@ -13,6 +13,13 @@
DELTA_DISTANCE,
};
+enum ENCODER_MODE{
+ X1_ENCODE,
+ X2_ENCODE,
+ X4_ENCODE,
+
+};
+
enum TYPE_NUMBER{
NORMAL,
DELTA,
@@ -36,11 +43,10 @@
void reset();
- void init(float _ppr, float _radius,float _dt);
-
+ void init(float _ppr, float _radius,float _dt,int mode);
private:
- void read();
-
+ void readAphaseRise();
+ void readAphaseFall();
float rpm, distance, omega, velocity, radius, delta_distance,
ppr, dt, dt_square, circle, acceleration;