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
Diff: MicRobot-Rev07_FUNZIONA.cpp
- Revision:
- 10:e38bc98718cc
- Parent:
- 9:2199376bbdd9
- Child:
- 11:da53d3e94a41
--- a/MicRobot-Rev07_FUNZIONA.cpp Mon Nov 04 18:42:31 2019 +0000 +++ b/MicRobot-Rev07_FUNZIONA.cpp Fri Feb 07 17:47:15 2020 +0000 @@ -49,6 +49,7 @@ // Definizione periferica seriale del Modulo BLE ELETT114A Serial myBLE(PA_9, PA_10, 9600); //Tx, Rx, bps + // Input di Reset per il Modulo BLE HC-05 DigitalOut BleRst(PA_8); @@ -372,10 +373,9 @@ /* MAIN */ /**********/ int main() -{ - MotoreCoda.period_ms(50); // periodo PWM - MotoreCoda.write (0.4); // velocità *** max 1.0 - +{ + MotoreCoda.period_ms(50); // periodo PWM + // messaggio di benvenuto pc.printf("\r\n************ Hallo ****************** \r\n"); pc.printf("*** Modulo di Ispezione Condutture ***\r\n"); @@ -489,6 +489,7 @@ pc.printf("Comando = %c, Parametro = %d \r\n", cCommandBLE, nParamBLE); // diagnostica cOldCommandBLE = cCommandBLE; nOldParamBLE = nParamBLE; + } //++++++++++++++++++++++++++++++++++++++++++++ FINE Interpreta Comandi da Pulsanti della APP ++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -566,6 +567,14 @@ } AntOutPWB.write(float(fL/100.0)); // DutyCycle del PWM Sinistro (Anteriore) } + if (nCountRiseEdge != nOldCountRiseEdge) //La coda si muove quando registra impulso + { + MotoreCoda.write (0.4); // velocità *** max 1.0 + } + else //La coda non si muove quando non registra impulso + { + MotoreCoda.write (0.0); // velocità *** max 1.0 + } //++++++++++++++++++++++ FINE Ottieni X e Y dal Joystick e trasformali in comandi per il motore Right e Left +++++++++++++++++++++++++++++ } //while (true) Ciclo principale