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.
Revision 2:10ce3d24df8e, committed 2019-03-01
- Comitter:
- YutaTogashi
- Date:
- Fri Mar 01 05:33:41 2019 +0000
- Parent:
- 0:33005fa67bfd
- Commit message:
- Encoder
Changed in this revision
| Encoder.cpp | Show annotated file Show diff for this revision Revisions of this file |
| Encoder.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Encoder.cpp Thu Dec 13 08:19:50 2018 +0000
+++ b/Encoder.cpp Fri Mar 01 05:33:41 2019 +0000
@@ -86,4 +86,8 @@
return 0;
break;
}
+}
+
+void Encoder::reset() {
+ count = 0.0f;
}
\ No newline at end of file
--- a/Encoder.h Thu Dec 13 08:19:50 2018 +0000
+++ b/Encoder.h Fri Mar 01 05:33:41 2019 +0000
@@ -25,7 +25,7 @@
void setup(int Ppr = 400,int Diameter = 0);
void calculate();
float getData(short ch);
-
+ void reset();
private:
InterruptIn Apulse;
InterruptIn Bpulse;