Yuta Togashi / motorDrive_SMB

Dependents:   Tourobo2022_TBCMotorDriver

Revision:
0:db4f58345725
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README.txt	Wed Mar 25 09:22:53 2020 +0000
@@ -0,0 +1,44 @@
+作成:20200326 冨樫
+このライブラリは,鳥羽のMotorDriverをSMB方式で使うためのライブラリです.
+
+【説明】
+・motorDriveSMB(PinName PwmH,PinName Phase)
+  [引数]
+    PwmH  : PWMHのピン(このピンからPWMを出力します)
+    Phase : PHASEのピン(このピンの出力によって回転方向が変化します)
+  [戻り値]
+    なし
+    
+・setupFrequency(float frequency)
+  [引数]
+    frequency : PWMの周波数
+  [戻り値]
+    なし
+    
+・setupLimitDuty(float lowerLimit,float upperLimit)
+  [引数]
+    lowerLimit : 出力するdutyの下限値(default:-1.0f)
+    upperLimit : 出力するdutyの上限値(default:1.0f)
+  [戻り値]
+    なし
+
+・output(float duty)
+  [引数]
+    duty : 出力するduty
+  [戻り値]
+    なし
+
+/**************************************************************************************************************************************************/
+(一例)
+#include "mbed.h"
+#include "motorDrive_SMB.h"
+
+motorDriveSMB motor(PWMHのピン,PHASEのピン);
+
+int main() {
+    motor.setupFrequency(20000.0f);             //周波数設定
+    motor.setupLimitDuty(-1.0f,1.0f);           //上限値・下限値を設定
+    while(1){
+        motor.output(0.50f);                    //PWMを出力
+    }
+}
\ No newline at end of file