Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DRV8830 IQS62x IQSDisplayTerminal UIT_ACM1602NI mbed
Fork of Nucleo_ACM1602_I2C_DC by
Revision 10:ef379cbc0004, committed 2017-10-02
- 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);
