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
Diff: Capteurs/Sensors.cpp
- Revision:
- 3:e76f0ece91ef
- Child:
- 4:5fc4815b0583
- Child:
- 5:2732931df96c
- Child:
- 9:68575180c7a7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Capteurs/Sensors.cpp Mon Dec 04 14:32:33 2017 +0000
@@ -0,0 +1,28 @@
+#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");
+}
+
+char * 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));
+}
\ No newline at end of file
