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.
Diff: EC.h
- Revision:
- 12:530f6184830a
- Parent:
- 10:216d5a573dc7
- Child:
- 25:d73c40fd4b55
--- a/EC.h	Tue Dec 13 07:38:51 2016 +0000
+++ b/EC.h	Fri Dec 16 07:07:27 2016 +0000
@@ -12,7 +12,7 @@
    */
 
 class Ec{
-    private:
+    protected:
         int S;  //A相B相のパターン(1~4)
         bool stateA,stateB; //A・B相の状態
         int count;  //カウント数 分解能分で一周
@@ -107,7 +107,7 @@
         ///四倍精度のcountの値を返す関数(double型)
         double getPreCount();
         ///エンコーダを初期状態に戻す関数 countやomegaの値を0にする
-        void reset();
+        virtual void reset();
         ///角速度計算の間隔dtを決めることができる(デフォルトは0.05秒)
         void setTime(double t);
         ///(Z相を使用する場合)回転回数を返す関数(int型)
@@ -284,5 +284,6 @@
         void ScZ(double target_RPM);
         void ScZ2(double target_RPM);
         void Accelarate(double target_duty);
+        virtual void reset();
 };
 #endif
\ No newline at end of file