![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Programme carte strategie (disco)
Dependencies: mbed SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac
Diff: main.cpp
- Revision:
- 31:833fc481b002
- Parent:
- 30:a1e37af4bbde
- Child:
- 34:6aa4b46b102e
diff -r a1e37af4bbde -r 833fc481b002 main.cpp --- a/main.cpp Fri Apr 20 09:16:13 2018 +0000 +++ b/main.cpp Tue Apr 24 18:09:51 2018 +0000 @@ -5,16 +5,21 @@ CAN can1(PB_8,PB_9); // Rx&Tx pour le CAN CAN can2(PB_5, PB_13); - +void bluetooth_init(void); DigitalIn choix_robot(PG_12); CANMessage msgRxBuffer[SIZE_FIFO]; unsigned char FIFO_ecriture; char strat_sd[10][SIZE+8]; char PATH[10][SIZE+8]; -Serial rn42(PG_14, PG_9); +//Serial rn42(PG_14, PG_9); +//Serial rn42(PA_1,PA_2); +Serial rn42_Tx(PA_2,NC); +Serial rn42_Rx(NC,PA_1); + Serial pc(USBTX,USBRX); -LiaisonBluetooth liaison(&rn42,&pc); +LiaisonBluetooth liaison_Rx(&rn42_Rx,&pc); +LiaisonBluetooth liaison_Tx(&rn42_Tx,&pc); char cheminFileStart[SIZE+8]; //Le chemin du fichier de strat, utiliser strcpy(cheminFileStart,"/local/strat.txt"); struct S_Instruction strat_instructions[SIZE_BUFFER_FILE]; //La liste des instruction chargé en mémoire @@ -64,9 +69,9 @@ lcd.DisplayStringAt(0, 0,(uint8_t *)"Initialisation petit robot", LEFT_MODE); #endif led1 = 1; - rn42.baud(115200); - pc.baud(115200); - //bluetooth_init(); + /*rn42.baud(115200); + pc.baud(115200);*/ + bluetooth_init(); //initRobot();//Initialisation du robot //initRobotActionneur(); lecture_fichier(); @@ -80,3 +85,19 @@ //AX12_doLoop();//Vérification de la position des AX12 } } + +void bluetooth_init(void){ + rn42_Tx.baud(115200); + rn42_Rx.baud(115200); + pc.baud(115200); + pc.printf("ok1"); + /*while(1){ + while(pc.readable()){ + rn42_Tx.putc(pc.getc()); + + } + while(rn42_Rx.readable()){ + pc.putc(rn42_Rx.getc()); + } + }*/ +}