Patrice HAESAERT
/
XBEE_emeteur
xbee e
emet_xbee.cpp@0:b2c100cfa6c9, 2021-10-20 (annotated)
- Committer:
- pathae
- Date:
- Wed Oct 20 17:18:34 2021 +0000
- Revision:
- 0:b2c100cfa6c9
XBEE emission
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pathae | 0:b2c100cfa6c9 | 1 | #include "mbed.h" |
pathae | 0:b2c100cfa6c9 | 2 | |
pathae | 0:b2c100cfa6c9 | 3 | Serial xbee(PA_9,PA_10); //Initalise xbee_lib |
pathae | 0:b2c100cfa6c9 | 4 | Serial pc(USBTX, USBRX); //Initalise PC serial comms |
pathae | 0:b2c100cfa6c9 | 5 | int temperature = 82; |
pathae | 0:b2c100cfa6c9 | 6 | int pression = 1234; |
pathae | 0:b2c100cfa6c9 | 7 | int vit_rot = 5678; |
pathae | 0:b2c100cfa6c9 | 8 | DigitalOut myled(LED2); |
pathae | 0:b2c100cfa6c9 | 9 | int main() |
pathae | 0:b2c100cfa6c9 | 10 | { |
pathae | 0:b2c100cfa6c9 | 11 | while(1) |
pathae | 0:b2c100cfa6c9 | 12 | { |
pathae | 0:b2c100cfa6c9 | 13 | xbee.printf ("$MOTEUR,%d,%d,%d*",temperature,pression,vit_rot); |
pathae | 0:b2c100cfa6c9 | 14 | //pc.printf("$MOTEUR,%d,%d,%d*\n\r",temperature,pression,vit_rot); |
pathae | 0:b2c100cfa6c9 | 15 | wait(1); |
pathae | 0:b2c100cfa6c9 | 16 | myled=!myled; |
pathae | 0:b2c100cfa6c9 | 17 | } |
pathae | 0:b2c100cfa6c9 | 18 | } |