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
- Committer:
- ghivert
- Date:
- 2017-12-04
- Revision:
- 5:2732931df96c
- Parent:
- 3:e76f0ece91ef
- Child:
- 6:b4f0687c4d14
File content as of revision 5:2732931df96c:
#include "Sensors.h"
#include "xbeeutils.h"
static Serial pc(USBTX,USBRX);
void calibrateSensors(){
pc.printf("Calibrating sensors...\n");
calibrate_EC();
calibrate_RTD();
//calibrate_PH();
pc.printf("Calibration completed!\n");
}
void getReadings(){
char phBuf[DEFAULT_BUFFER_SIZE], ECBuf[DEFAULT_BUFFER_SIZE], RTDBuf[DEFAULT_BUFFER_SIZE], TxBuf[DEFAULT_BUFFER_SIZE];
read_EC(ECBuf);
read_RTD(RTDBuf);
read_PH(phBuf);
sprintf(TxBuf,"%s;%s;%s",RTDBuf,phBuf,ECBuf);
pc.printf("%s\n",TxBuf);
xbee_broadcast(TxBuf,strlen(TxBuf)+1);
pc.printf("TxBuf strlen: %i\n",strlen(TxBuf));
}
