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: BLE_API X_NUCLEO_IDB0XA1 X_NUCLEO_IHM02A1 mbed
Fork of Motor_Ble_v1201820223FINAL by
Revision 13:d7aa688cd990, committed 2018-02-24
- Comitter:
- yong304
- Date:
- Sat Feb 24 10:49:14 2018 +0000
- Parent:
- 12:407779f755d0
- Commit message:
- ultimate final
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 407779f755d0 -r d7aa688cd990 main.cpp
--- a/main.cpp Fri Feb 23 08:52:13 2018 +0000
+++ b/main.cpp Sat Feb 24 10:49:14 2018 +0000
@@ -59,8 +59,8 @@
L6470_init_t init[L6470DAISYCHAINSIZE] = {
/* First Motor. */
{
- 9.0, /* Motor supply voltage in V. */
- 400, /* Min number of steps per revolution for the motor. */
+ 12.0, /* Motor supply voltage in V. */
+ 200, /* Min number of steps per revolution for the motor. */
1.7, /* Max motor phase voltage in A. */
3.06, /* Max motor phase voltage in V. */
300.0, /* Motor initial speed [step/s]. */
@@ -87,8 +87,8 @@
/* Second Motor. */
{
- 9.0, /* Motor supply voltage in V. */
- 400, /* Min number of steps per revolution for the motor. */
+ 12.0, /* Motor supply voltage in V. */
+ 200, /* Min number of steps per revolution for the motor. */
1.7, /* Max motor phase voltage in A. */
3.06, /* Max motor phase voltage in V. */
300.0, /* Motor initial speed [step/s]. */
@@ -166,8 +166,14 @@
actuatedLED=0 ;
SOFTSTOP();
}
-
-
+ else if (*(params->data)== 0x46)
+ {
+ actuatedLED=1 ;
+ }
+ else if (*(params->data)== 0x47)
+ {
+ actuatedLED=0 ;
+ }
}
@@ -284,8 +290,8 @@
// int position = motors[0]->get_position();
/* Preparing each motor to perform a run at a specified speed. */
- motors[0]->prepare_run(StepperMotor::FWD, 400);
- motors[1]->prepare_run(StepperMotor::BWD, 400);
+ motors[0]->prepare_run(StepperMotor::BWD, 400);
+ motors[1]->prepare_run(StepperMotor::FWD, 400);
/* Performing the action on each motor at the same time. */
x_nucleo_ihm02a1->perform_prepared_actions();
@@ -305,8 +311,8 @@
// int position = motors[0]->get_position();
/* Preparing each motor to perform a run at a specified speed. */
- motors[0]->prepare_run(StepperMotor::BWD, 400);
- motors[1]->prepare_run(StepperMotor::FWD, 400);
+ motors[0]->prepare_run(StepperMotor::FWD, 400);
+ motors[1]->prepare_run(StepperMotor::BWD, 400);
/* Performing the action on each motor at the same time. */
x_nucleo_ihm02a1->perform_prepared_actions();
