Robert Tomczak
/
XBEE_Simple_Emeteur
BTS SNEC
Diff: emet_xbee.cpp
- Revision:
- 1:0672144e8101
- Parent:
- 0:b2c100cfa6c9
diff -r b2c100cfa6c9 -r 0672144e8101 emet_xbee.cpp --- a/emet_xbee.cpp Wed Oct 20 17:18:34 2021 +0000 +++ b/emet_xbee.cpp Fri Oct 22 09:21:33 2021 +0000 @@ -1,18 +1,16 @@ -#include "mbed.h" - +#include "mbed.h"//G com 9 Serial xbee(PA_9,PA_10); //Initalise xbee_lib Serial pc(USBTX, USBRX); //Initalise PC serial comms -int temperature = 82; -int pression = 1234; -int vit_rot = 5678; -DigitalOut myled(LED2); + int main() { - while(1) - { - xbee.printf ("$MOTEUR,%d,%d,%d*",temperature,pression,vit_rot); - //pc.printf("$MOTEUR,%d,%d,%d*\n\r",temperature,pression,vit_rot); - wait(1); - myled=!myled; - } + pc.printf("Un simple emeteur"); + while(1) { + for (int i=0; i<=100; i++) { + xbee.printf ("Coucou N %d\r\n",i); + pc.printf ("Envoie de : Coucou N %d\r\n",i); + wait(1); + } + } } +