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@8:62898720a01d, 2017-12-05 (annotated)
- Committer:
- ghivert
- Date:
- Tue Dec 05 19:36:25 2017 +0000
- Revision:
- 8:62898720a01d
- Parent:
- 7:46889f2aa444
- Child:
- 10:29d5ca2beffb
final?;
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 | |
| ghivert | 8:62898720a01d | 24 | //sprintf(TxBuf,"%s;%s;%s",RTDBuf+1,phBuf+1,ECBuf+1); |
| ghivert | 8:62898720a01d | 25 | sprintf(TxBuf,"%s;%s;%s;\0","1.1","2.2","3.3"); |
| ghivert | 8:62898720a01d | 26 | pc.printf("%s\n",TxBuf); |
| ghivert | 8:62898720a01d | 27 | RemoteXBeeZB xbzb = get_remote_node(); |
| ghivert | 8:62898720a01d | 28 | const RemoteXBeeZB& remoteDevice = xbzb; |
| ghivert | 8:62898720a01d | 29 | |
| ghivert | 8:62898720a01d | 30 | xbee_send(remoteDevice, TxBuf, strlen(TxBuf)); |
| ghivert | 8:62898720a01d | 31 | pc.printf("TxBuf strlen: %i\n",strlen(TxBuf)); |
| ggs22 | 3:e76f0ece91ef | 32 | } |
