20180223 ULTIMATE FINAL

Dependencies:   BLE_API X_NUCLEO_IDB0XA1 X_NUCLEO_IHM02A1 mbed

Fork of Motor_Ble_v1201820223FINAL by NEHSROBOT

Revision:
13:d7aa688cd990
Parent:
12:407779f755d0
--- 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();