juijiu

Dependencies:   HIDScope QEI biquadFilter mbed

Fork of MotorArchitecture1-11 by Wouter Schuttert

Revision:
3:055eb9f256fc
Parent:
2:fa90eaa14f99
Child:
4:34ad002cb646
--- a/main.cpp	Fri Oct 26 10:59:24 2018 +0000
+++ b/main.cpp	Fri Oct 26 11:46:25 2018 +0000
@@ -3,7 +3,6 @@
 #include "HIDScope.h"
 #include <stdio.h>   
 #include <math.h>      
-#include <iostream>
 #include "QEI.h"
 
 
@@ -329,16 +328,17 @@
 int main()
 {        
     motor1_speed_control.period_us(60); //60 microseconds PWM period, 16.7 kHz
-           
-    //timer.start();
-    //loop_timer.attach(&loop_function, Ts);    
-    //sample_timer.attach(&scopedata, Ts);    
-    //sample_timer2.attach(&filterall, Ts);
+    
+    motor1_direction = 1; //set motor 1 to run counterclockwise (positive) direction for calibration
+    motor1_speed_control = 0.55;//to make sure the motor will not run at too high velocity
+    motor2_direction = 0; // set motor 2 to run clockwise (negative) direction
+    motor2_speed_control = 0.55;      
+    timer.start();
+    loop_timer.attach(&loop_function, Ts);    
+    sample_timer.attach(&scopedata, Ts);    
+    sample_timer2.attach(&filterall, Ts);
 
     while (true) { 
-     motor1_direction = 1; //set motor 1 to run counterclockwise (positive) direction for calibration
-    motor1_speed_control = 0.55;//to make sure the motor will not run at too high velocity
-    motor2_direction = 0; // set motor 2 to run clockwise (negative) direction
-    motor2_speed_control = 0.55;             
+               
     }
 }
\ No newline at end of file