4年工学基礎研究(前期)で作成したペンプロッタの制御プログラム

Dependencies:   SPM_simple mbed trapezoidalMotionCal

Revision:
3:ddb5ca27e94b
Parent:
2:80eb19e9091e
--- a/main.cpp	Fri Aug 04 00:53:48 2017 +0000
+++ b/main.cpp	Fri Aug 04 03:47:41 2017 +0000
@@ -12,7 +12,7 @@
 //stepMotor y_axis(PB_1  ,PB_2  ,PB_12 ,PA_11);
 stepMotor y_axis(PA_11  ,PB_12  ,PB_2 ,PB_1);
 
-trapezoidalMotionCal motionCal(50, 50, 4000, 10000, -10000);
+trapezoidalMotionCal motionCal(50, 50, 500, 5000, -5000);
 
 PwmOut servo(PC_6);
 PwmOut speaker(/*PC_8*/PA_15);
@@ -20,7 +20,7 @@
 DigitalIn x_originSW(PA_0);
 DigitalIn y_originSW(PA_1);
 
-DigitalOut myled(LED1);
+DigitalOut myled(PA_5);
 Serial pc(USBTX,USBRX);
 Serial debugPort(PA_9,PA_10);
 
@@ -119,7 +119,6 @@
     
     wait_ms(1000);
     
-    pc.printf("Hello\r\n");
     debugPort.printf("Hello Debug Port\r\n");
     
     x_axis.lock();
@@ -150,8 +149,9 @@
     sendRequest();
     
     while(1) {
-        
+        myled = 1;
         while(job == 0);
+        myled = 0;
         
         if(nextMode != 0){ // move mode
             runningPosition = nextPosition;