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@6:b4f0687c4d14, 2017-12-04 (annotated)
- Committer:
- ghivert
- Date:
- Mon Dec 04 20:43:20 2017 +0000
- Revision:
- 6:b4f0687c4d14
- Parent:
- 5:2732931df96c
- Parent:
- 4:5fc4815b0583
- Child:
- 7:46889f2aa444
merge;
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 | |
| ghivert | 5:2732931df96c | 16 | void 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 | } |
