quad

Dependencies:   haseMD lpf

Files at this revision

API Documentation at this revision

Comitter:
THtakahiro702286
Date:
Sat Jan 25 09:13:29 2020 +0000
Commit message:
mdpractice

Changed in this revision

.gitignore Show annotated file Show diff for this revision Revisions of this file
haseMD.lib Show annotated file Show diff for this revision Revisions of this file
lpf.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Sat Jan 25 09:13:29 2020 +0000
@@ -0,0 +1,4 @@
+.build
+.mbed
+projectfiles
+*.py*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/haseMD.lib	Sat Jan 25 09:13:29 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/THtakahiro702286/code/haseMD/#24c2a636c6f0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lpf.lib	Sat Jan 25 09:13:29 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/THtakahiro702286/code/lpf/#dedf16377e0f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Jan 25 09:13:29 2020 +0000
@@ -0,0 +1,33 @@
+#include "mbed.h"
+#include "haseMD.h"
+#include "lpf.h"
+
+HaseMD md[4] = { HaseMD(PA_6),HaseMD(PA_7), HaseMD(PA_9),HaseMD(PB_10) };
+//DigitalIn DS[3] = { DigitalIn(PC_12), DigitalIn(PC_10), DigitalIn(PD_2) };
+Timer tim;
+Serial pc(USBTX,USBRX,115200);
+lpf mdlpf(1.0/300,0.005);
+//DigitalIn fallut(PB_6);
+//DigitalIn otw(PC_7);
+
+int main()
+{
+    tim.start();
+    double pwm = 0.0,put;
+    
+    while (true) {
+        
+        pwm = sin(tim/3.0);
+        for(int i=0; i < 4; i++)
+        {
+            md[i].setSpeed(pwm);
+            
+        }
+        mdlpf.path_value(pwm);
+//        pwm += ((pwm < 0.1) - (pwm > 0.9)) * 0.1;
+//        put = 0.5 + pwm / 2.0;
+        put = pwm * 0.9 / 2 + 0.5;
+        pc.printf("%f \n\r",put);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Sat Jan 25 09:13:29 2020 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#430e64fce8098fd5e54f6de32f3f029f35dc705f