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: mbed X_NUCLEO_IHM03A1_for
Diff: main.cpp
- Revision:
- 50:144a92eeddb9
- Parent:
- 49:2cfa7a02ac1e
- Child:
- 51:51b5498e00c5
--- a/main.cpp Fri Feb 05 11:24:07 2021 +0000 +++ b/main.cpp Sat Feb 27 16:18:50 2021 +0000 @@ -415,7 +415,7 @@ #endif #endif #if defined(provaStepper) - motor->run(StepperMotor::FWD,150.0f); + motor->run(StepperMotor::FWD,500.00f); #endif #endif } else { @@ -429,7 +429,7 @@ #endif #endif #if defined(provaStepper) - motor->run(StepperMotor::BWD,100.0f); + motor->run(StepperMotor::BWD,70.0f); #endif #endif } @@ -1734,7 +1734,7 @@ //motor->disable_flag_irq(); /* Attaching an error handler */ - //motor->attach_error_handler(&my_error_handler); + motor->attach_error_handler(&my_error_handler); #endif wait(1.0f); for (int a=0; a<5; a++) { @@ -1807,15 +1807,22 @@ SDmotorPWM.write(1.0f); // duty cycle = stop TBmotorDirecti=TBforward; // tb motor direction set + #if defined(provaDC) + DC_brake=0; + DC_forward=1; + DC_prepare(); + SDmotorPWM.write(0.5f); // duty cycle = stop + #endif + #if defined(provaStepper) TBmotorRst=1; TBmotorDirecti=TBforward; // definire il pin di clock che è PB_3 #if defined(Zucca) - motor->run(StepperMotor::BWD,100.0f); + motor->run(StepperMotor::BWD,50.0f); //motor->step_clock_mode_enable(StepperMotor::FWD); #else - motor->run(StepperMotor::BWD,100.0f); + motor->run(StepperMotor::BWD,50.0f); //motor->step_clock_mode_enable(StepperMotor::BWD); #endif // attiva l'out per il controllo dello stepper in stepClockMode @@ -1876,6 +1883,47 @@ alarmEnable=false; } + #if defined(pcSerial) + #if defined(perProva) + if ((tractorSpeedRead==1)&&(holdInSpeed==0)){ + pc.printf("speed input ON\n"); + holdInSpeed=1; + #if defined(provaStepper) + motor->run(StepperMotor::BWD,200.0f); + #endif + } + if ((tractorSpeedRead==0)&&(holdInSpeed==1)){ + pc.printf("speed input OFF\n"); + holdInSpeed=0; + } + if ((DcEncoder==1)&&(holdInDc==0)){ + pc.printf("dc encoder input ON\n"); + holdInDc=1; + } + if ((DcEncoder==0)&&(holdInDc==1)){ + pc.printf("dc encoder input OFF\n"); + holdInDc=0; + } + + if ((seedWheelZeroPinInputRev==1)&&(holdInSD==0)){ + pc.printf("SD input ON\n"); + holdInSD=1; + } + if ((seedWheelZeroPinInputRev==0)&&(holdInSD==1)){ + pc.printf("SD input OFF\n"); + holdInSD=0; + } + + if ((TBzeroPinInputRev==1)&&(holdInTB==0)){ + pc.printf("TB input ON\n"); + holdInTB=1; + } + if ((TBzeroPinInputRev==0)&&(holdInTB==1)){ + pc.printf("TB input OFF\n"); + holdInTB=0; + } + #endif + #endif // inversione segnali ingressi #if !defined(simulaBanco) seedWheelZeroPinInput = !seedWheelZeroPinInputRev; @@ -2203,7 +2251,7 @@ pc.printf("TBoldPos: %d\n",TBoldPosition); #endif #endif - #if defined(perProva) + #if defined(TBperS) pc.printf(" ildato %d Actual %d\n", ildato, TBactualPosition); #endif #else