
code avec modifs, programme mit dans les robots pour les derniers matchs
Dependencies: mbed SerialHalfDuplex SDFileSystem liaison_Bluetooth ident_crac DISCO-F469NI_portrait
Revision 25:0d3eeb6da9e3, committed 2020-07-08
- Comitter:
- gabrieltetar
- Date:
- Wed Jul 08 08:23:28 2020 +0000
- Parent:
- 24:1a13c998c7ac
- Child:
- 26:b7967815bb7d
- Commit message:
- bluet
Changed in this revision
Strategie/liaison_Bluetooth.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Strategie/liaison_Bluetooth.lib Wed Jul 08 08:23:28 2020 +0000 @@ -0,0 +1,1 @@ +http://os.mbed.com/teams/CRAC-Team/code/liaison_Bluetooth/#1c3ff1ff1bc0
--- a/main.cpp Wed Jul 08 08:19:16 2020 +0000 +++ b/main.cpp Wed Jul 08 08:23:28 2020 +0000 @@ -8,6 +8,7 @@ char PATH[10][SIZE+8]; Serial pc(USBTX,USBRX); 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 unsigned char nb_instructions; //Le nombre d'instruction dans le fichier de strategie unsigned char actual_instruction;//La ligne de l'instruction en cours d'execution @@ -20,7 +21,10 @@ DigitalOut led2(LED2);//Led d'indication de problème, si elle clignote, c'est pas bon DigitalOut led3(LED3);//Led d'indication de problème, si elle clignote, c'est pas bon DigitalOut led4(LED4);//Led d'indication de problème, si elle clignote, c'est pas bon - +void bluetooth_init(void); +LiaisonBluetooth liaison_Rx(&rn42_Rx,&pc); +LiaisonBluetooth liaison_Tx(&rn42_Tx,&pc); +LiaisonBluetooth liaison_pr(&rn42_pr,&pc); /****************************************************************************************/ /* FUNCTION NAME: canRx_ISR */ /* DESCRIPTION : Interruption en réception sur le CAN */ @@ -43,6 +47,7 @@ can1.frequency(1000000); // fréquence de travail 1Mbit/s can2.attach(&canRx_ISR); // création de l'interrupt attachée à la réception sur le CAN can2.frequency(1000000); + bluetooth_init(); lcd.DisplayStringAt(0, 0,(uint8_t *)"Initialisation", LEFT_MODE); led1 = 1; lecture_fichier(); //bloquant si pas de carte SD @@ -54,4 +59,19 @@ canProcessRx(); } } - +void bluetooth_init(void){ + rn42_Tx.baud(115200); + rn42_Rx.baud(115200); + rn42_pr.baud(115200); + pc.baud(115200); + pc.printf("ok1"); + /*while(1){ // sert au paramètrage des module RN42 + while(pc.readable()){ + rn42_Tx.putc(pc.getc()); + + } + while(rn42_Rx.readable()){ + pc.putc(rn42_Rx.getc()); + } + }*/ +}