Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: XBeeLib mbed-rtos mbed
Capteurs/Sensors.cpp@4:5fc4815b0583, 2017-12-04 (annotated)
- Committer:
- jphilip
- Date:
- Mon Dec 04 15:41:30 2017 +0000
- Revision:
- 4:5fc4815b0583
- Parent:
- 3:e76f0ece91ef
- Child:
- 6:b4f0687c4d14
Ignore first Ascii character received from sensors
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ggs22 | 3:e76f0ece91ef | 1 | #include "Sensors.h" |
| ggs22 | 3:e76f0ece91ef | 2 | #include "xbeeutils.h" |
| ggs22 | 3:e76f0ece91ef | 3 | |
| ggs22 | 3:e76f0ece91ef | 4 | static Serial pc(USBTX,USBRX); |
| ggs22 | 3:e76f0ece91ef | 5 | |
| ggs22 | 3:e76f0ece91ef | 6 | void calibrateSensors(){ |
| ggs22 | 3:e76f0ece91ef | 7 | |
| ggs22 | 3:e76f0ece91ef | 8 | pc.printf("Calibrating sensors...\n"); |
| ggs22 | 3:e76f0ece91ef | 9 | |
| ggs22 | 3:e76f0ece91ef | 10 | calibrate_EC(); |
| ggs22 | 3:e76f0ece91ef | 11 | calibrate_RTD(); |
| ggs22 | 3:e76f0ece91ef | 12 | //calibrate_PH(); |
| ggs22 | 3:e76f0ece91ef | 13 | pc.printf("Calibration completed!\n"); |
| ggs22 | 3:e76f0ece91ef | 14 | } |
| ggs22 | 3:e76f0ece91ef | 15 | |
| ggs22 | 3:e76f0ece91ef | 16 | char * getReadings(){ |
| ggs22 | 3:e76f0ece91ef | 17 | |
| ggs22 | 3:e76f0ece91ef | 18 | char phBuf[DEFAULT_BUFFER_SIZE], ECBuf[DEFAULT_BUFFER_SIZE], RTDBuf[DEFAULT_BUFFER_SIZE], TxBuf[DEFAULT_BUFFER_SIZE]; |
| ggs22 | 3:e76f0ece91ef | 19 | |
| ggs22 | 3:e76f0ece91ef | 20 | read_EC(ECBuf); |
| ggs22 | 3:e76f0ece91ef | 21 | read_RTD(RTDBuf); |
| ggs22 | 3:e76f0ece91ef | 22 | read_PH(phBuf); |
| ggs22 | 3:e76f0ece91ef | 23 | |
| jphilip | 4:5fc4815b0583 | 24 | sprintf(TxBuf,"%s;%s;%s",RTDBuf+1,phBuf+1,ECBuf+1); |
| ggs22 | 3:e76f0ece91ef | 25 | pc.printf("%s\n",TxBuf); |
| ggs22 | 3:e76f0ece91ef | 26 | xbee_broadcast(TxBuf,strlen(TxBuf)+1); |
| ggs22 | 3:e76f0ece91ef | 27 | pc.printf("TxBuf strlen: %i\n",strlen(TxBuf)); |
| ggs22 | 3:e76f0ece91ef | 28 | } |
