2 Motores + Joystick
Dependencies: X_NUCLEO_IHM01A1 TextLCD
Fork of HelloWorld_IHM01A1_2Motors_mbedOS by
Revision 33:b276c9c00088, committed 2018-04-24
- Comitter:
- leogrotti
- Date:
- Tue Apr 24 13:51:09 2018 +0000
- Parent:
- 32:481674c0f90d
- Child:
- 34:098efd69c86d
- Commit message:
- 2
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Apr 23 10:55:24 2018 +0000
+++ b/main.cpp Tue Apr 24 13:51:09 2018 +0000
@@ -72,14 +72,14 @@
L6474_init_t init = {
160, /* Acceleration rate in pps^2. Range: (0..+inf). */
160, /* Deceleration rate in pps^2. Range: (0..+inf). */
- 2400, /* Maximum speed in pps. Range: (30..10000]. */
- 30, /* Minimum speed in pps. Range: [30..10000). */
- 250, /* Torque regulation current in mA. Range: 31.25mA to 4000mA. */
- L6474_OCD_TH_750mA, /* Overcurrent threshold (OCD_TH register). */
+ 4000, /* Maximum speed in pps. Range: (30..10000]. */
+ 1300, /* Minimum speed in pps. Range: [30..10000). */
+ 1500, /* Torque regulation current in mA. Range: 31.25mA to 4000mA. */
+ L6474_OCD_TH_1875mA, /* Overcurrent threshold (OCD_TH register). */
L6474_CONFIG_OC_SD_ENABLE, /* Overcurrent shutwdown (OC_SD field of CONFIG register). */
L6474_CONFIG_EN_TQREG_TVAL_USED, /* Torque regulation method (EN_TQREG field of CONFIG register). */
- L6474_STEP_SEL_1, /* Step selection (STEP_SEL field of STEP_MODE register). */
- L6474_SYNC_SEL_1, /* Sync selection (SYNC_SEL field of STEP_MODE register). */
+ L6474_STEP_SEL_1_2, /* Step selection (STEP_SEL field of STEP_MODE register). */
+ L6474_SYNC_SEL_1_2, /* Sync selection (SYNC_SEL field of STEP_MODE register). */
L6474_FAST_STEP_12us, /* Fall time value (T_FAST field of T_FAST register). Range: 2us to 32us. */
L6474_TOFF_FAST_8us, /* Maximum fast decay time (T_OFF field of T_FAST register). Range: 2us to 32us. */
3, /* Minimum ON time in us (TON_MIN register). Range: 0.5us to 64us. */
@@ -180,7 +180,7 @@
if (u>0.520) {
motor1->set_min_speed(minspeed);
- motor1->set_step_mode(step_mode_t_1);
+ // motor1->set_step_mode(step_mode_t_1_2);
motor1->run(StepperMotor::FWD);
speed1 = motor1->get_speed();
printf("velocidade: motor 1: %d \r\n",speed1);
