Thinkbed / Mbed 2 deprecated Nucleo_ACM1602_I2C_DC_Angle

Dependencies:   DRV8830 IQS62x IQSDisplayTerminal UIT_ACM1602NI mbed

Fork of Nucleo_ACM1602_I2C_DC by Thinkbed

Files at this revision

API Documentation at this revision

Comitter:
8mona
Date:
Mon Oct 02 19:38:45 2017 +0000
Parent:
9:b58e7d72a91c
Child:
11:80b6c5d77073
Commit message:
re-define moving profile;

Changed in this revision

MotorMove.cpp 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
--- a/MotorMove.cpp	Mon Oct 02 19:12:02 2017 +0000
+++ b/MotorMove.cpp	Mon Oct 02 19:38:45 2017 +0000
@@ -69,7 +69,51 @@
            flag_down_stopping=1;
            //bflag_down=0;
         }
-                        
+
+
+        if (bflag_up==1 && bflag_upped==0)
+          {
+                if (accel_count<(ACCEL_SIZE-1))
+                {
+                    speed = vol_accel[accel_count];
+                    accel_count++;
+                }
+                else
+                {
+                    speed = vol_accel[ACCEL_SIZE-1];    
+                }
+          }
+        else if(bflag_up==1 && bflag_upped==1)
+           {
+                    speed=vol_decel[0];
+                    bflag_up=0;
+           }
+        else if (bflag_down==1 && bflag_downed==0)
+          {
+                if (accel_count<(ACCEL_SIZE-1))
+                {
+                    speed = vol_accel[accel_count];
+                    accel_count++;
+                }
+                else
+                {
+                    speed = vol_accel[ACCEL_SIZE-1];    
+                }
+          }
+        else if(bflag_down==1 && bflag_downed==1)
+           {
+                    speed=vol_decel[0];
+                    bflag_down=0;
+           }
+        
+        
+        
+         else
+         {
+             speed=0;
+        }
+        
+        /*              
         if (bflag_up==1)
           {
             if  (flag_up_stopping==0)
@@ -132,6 +176,7 @@
          {
              speed=0;
         }
+        */
                          
 
         //move motor before push stopping switch 
--- a/main.cpp	Mon Oct 02 19:12:02 2017 +0000
+++ b/main.cpp	Mon Oct 02 19:38:45 2017 +0000
@@ -195,7 +195,9 @@
         lspeed=    mvalL.ReturnMotorVol(cnt, sw_in[0],sw_in[1]);
         rspeed=   -mvalR.ReturnMotorVol(cnt, sw_in[2],sw_in[3]);
         
+        
         motorL.speed(lspeed);
+        wait_ms(1);
         motorR.speed(rspeed);
         //motorL.speed(0.5);
         //motorR.speed(0.3);