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.
Diff: debugBT.cpp
- Revision:
- 4:ad9b7355332e
- Child:
- 5:34ed652f8c31
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debugBT.cpp Sat Jul 18 17:09:08 2020 +0000
@@ -0,0 +1,38 @@
+// Nom du fichier : debugBT.cpp
+#include "pins.h"
+
+// Variables globales & timers
+Serial bt(PC_6,PC_7);
+
+void bluetoothIT()
+{
+ static int i=0;
+ static char buffer[10]=""; // Tableau qui contient la chaine de caractère rentrée dans le terminal.
+ static char cmd[Lcmd]=""; // Variable qui retient que les premiers caractères qui représentent la commande.
+
+ //printf("bt.readable = %d \r\n",bt.readable());
+ while(bt.readable()) { // if(bt.readable())
+ //pc.printf("bt.readable = %d \r\n",bt.readable());
+ buffer[i]=bt.getc();
+ pc.printf("%c",buffer[i]);
+ bt.printf("%c",buffer[i]);
+ i++;
+ }
+
+ if(buffer[i-1]=='\r') {
+ pc.printf("\r\n");
+ bt.printf("\r\n");
+ i=0;
+
+ copieTab(buffer,cmd);
+
+ switch(cmdType) {
+ case 1 : // Commande test angle
+ StringToAngle(cmd);
+ cmdType=0;
+ break;
+ default : // Commande par défaut
+ cmdChoice(cmd);
+ }
+ }
+}