Robert Tomczak
/
XBEE_Simple_Emeteur
BTS SNEC
emet_xbee.cpp@1:0672144e8101, 2021-10-22 (annotated)
- Committer:
- rtk
- Date:
- Fri Oct 22 09:21:33 2021 +0000
- Revision:
- 1:0672144e8101
- Parent:
- 0:b2c100cfa6c9
Emission xbee
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rtk | 1:0672144e8101 | 1 | #include "mbed.h"//G com 9 |
pathae | 0:b2c100cfa6c9 | 2 | Serial xbee(PA_9,PA_10); //Initalise xbee_lib |
pathae | 0:b2c100cfa6c9 | 3 | Serial pc(USBTX, USBRX); //Initalise PC serial comms |
rtk | 1:0672144e8101 | 4 | |
pathae | 0:b2c100cfa6c9 | 5 | int main() |
pathae | 0:b2c100cfa6c9 | 6 | { |
rtk | 1:0672144e8101 | 7 | pc.printf("Un simple emeteur"); |
rtk | 1:0672144e8101 | 8 | while(1) { |
rtk | 1:0672144e8101 | 9 | for (int i=0; i<=100; i++) { |
rtk | 1:0672144e8101 | 10 | xbee.printf ("Coucou N %d\r\n",i); |
rtk | 1:0672144e8101 | 11 | pc.printf ("Envoie de : Coucou N %d\r\n",i); |
rtk | 1:0672144e8101 | 12 | wait(1); |
rtk | 1:0672144e8101 | 13 | } |
rtk | 1:0672144e8101 | 14 | } |
pathae | 0:b2c100cfa6c9 | 15 | } |
rtk | 1:0672144e8101 | 16 |