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
Revision 5:b777c4f0eb63, committed 2019-07-26
- Comitter:
- pinofal
- Date:
- Fri Jul 26 07:33:36 2019 +0000
- Parent:
- 4:19d1ac0f3ec2
- Child:
- 6:92b0e17593e0
- Commit message:
- revisione ultima;
Changed in this revision
| BLE-MegaPiSea_Rev3_WIP.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/BLE-MegaPiSea_Rev3_WIP.cpp Fri Jul 26 07:19:10 2019 +0000
+++ b/BLE-MegaPiSea_Rev3_WIP.cpp Fri Jul 26 07:33:36 2019 +0000
@@ -258,7 +258,7 @@
//++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++ INIZIO Ciclo Principale +++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++
- /*
+
while(true)
{
//Ottieni X e Y dal Joystick e trasformali in comandi per il motore Right e Left:
@@ -269,7 +269,32 @@
//Calcola L: L= (V-W)/2
//Scala i valori di L e R in base all'hardware.
//invia i valori al robot.
-
+ if(cCommandBLE != cOldCommandBLE)
+ {
+
+ switch (cCommandBLE)
+ {
+ case 'A':
+ {
+ myLed = 1;
+ }; break;
+ case 'B':
+ {
+ myLed = 0;
+ }; break;
+ case 'C':
+ {
+ Light = 1;
+ }; break;
+ case 'D':
+ {
+ Light = 0;
+ }; break;
+ default: break;
+ }
+ // pc.printf("Comando = %c \r\n", cCommandBLE); // diagnostica
+ cOldCommandBLE = cCommandBLE;
+ }
// se ci sono stati cambiamenti nella posizione del joistick, cambia i comandi di velocità delle ruote
if( (fX != fOldX) || (fY != fOldY))
{
@@ -338,7 +363,7 @@
AntOutPWB.write(float(fL/100.0)); // DutyCycle del PWM Sinistro (Anteriore)
}
} //while (true) Ciclo principale
- */
+
//++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++ FINE Ciclo Principale +++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -385,7 +410,7 @@
//++++++++++++ FINE ricezione comandi BLE ++++++++++++
*/
//++++++++++++ INIZIO Test modalità di funzionamento Motori con PWM ++++++++++++
-
+ /*
PostOutBI1 = 0;
PostOutBI2 = 0;
AntOutBI1 = 0;
@@ -602,7 +627,7 @@
}
} // while(true) Test motore con PWM
-
+ */
//++++++++++++ FINE Test Motore con PWM ++++++++++++
//++++++++++++ INIZIO Test PWM tramite BLE ++++++++++++