Не так давно появилась потребность измерения качества воды , у заграничных товарищей приобрел датчик https://www.dfrobot.com/wiki/index.php/ ... U:_SEN0244
температурная компенсация у него программно добавляется выносным датчиком каким захочешь ( лишь бы влагостойким ).
библиотеки и примеры они прилагают , все компилируется. пытаюсь упаковать в блок все тоже компилируется но если добавить выводы то компилятор ругается .
Прошу помощи у знающих людей! пример с собранным блоком (без выходов и входа температуры прилагаю) помогите пожалуйста добавить выход показаний и вход температуры
СпойлерПоказать
/***************************************************
DFRobot Gravity: Analog TDS Sensor/Meter
<https://www.dfrobot.com/wiki/index.php/ ... U:_SEN0244>
***************************************************
This sample code shows how to read the tds value and calibrate it with the standard buffer solution.
707ppm(1413us/cm)@25^c standard buffer solution is recommended.
Created 2018-1-3
By Jason <jason.ling@dfrobot.com@dfrobot.com>
GNU Lesser General Public License.
See <http://www.gnu.org/licenses/> for details.
All above must be included in any redistribution.
****************************************************/
/***********Notice and Trouble shooting***************
1. This code is tested on Arduino Uno with Arduino IDE 1.0.5 r2 and 1.8.2.
2. Calibration CMD:
enter -> enter the calibration mode
cal:tds value -> calibrate with the known tds value(25^c). e.g.cal:707
exit -> save the parameters and exit the calibration mode
****************************************************/
#include <EEPROM.h>
#include "GravityTDS.h"
#define TdsSensorPin A1
GravityTDS gravityTds;
float temperature = 25,tdsValue = 0;
void setup()
{
Serial.begin(115200);
gravityTds.setPin(TdsSensorPin);
gravityTds.setAref(5.0); //reference voltage on ADC, default 5.0V on Arduino UNO
gravityTds.setAdcRange(1024); //1024 for 10bit ADC;4096 for 12bit ADC
gravityTds.begin(); //initialization
}
void loop()
{
//temperature = readTemperature(); //add your temperature sensor and read it
gravityTds.setTemperature(temperature); // set the temperature and execute temperature compensation
gravityTds.update(); //sample and calculate
tdsValue = gravityTds.getTdsValue(); // then get the value
Serial.print(tdsValue,0);
Serial.println("ppm");
delay(1000);
}
DFRobot Gravity: Analog TDS Sensor/Meter
<https://www.dfrobot.com/wiki/index.php/ ... U:_SEN0244>
***************************************************
This sample code shows how to read the tds value and calibrate it with the standard buffer solution.
707ppm(1413us/cm)@25^c standard buffer solution is recommended.
Created 2018-1-3
By Jason <jason.ling@dfrobot.com@dfrobot.com>
GNU Lesser General Public License.
See <http://www.gnu.org/licenses/> for details.
All above must be included in any redistribution.
****************************************************/
/***********Notice and Trouble shooting***************
1. This code is tested on Arduino Uno with Arduino IDE 1.0.5 r2 and 1.8.2.
2. Calibration CMD:
enter -> enter the calibration mode
cal:tds value -> calibrate with the known tds value(25^c). e.g.cal:707
exit -> save the parameters and exit the calibration mode
****************************************************/
#include <EEPROM.h>
#include "GravityTDS.h"
#define TdsSensorPin A1
GravityTDS gravityTds;
float temperature = 25,tdsValue = 0;
void setup()
{
Serial.begin(115200);
gravityTds.setPin(TdsSensorPin);
gravityTds.setAref(5.0); //reference voltage on ADC, default 5.0V on Arduino UNO
gravityTds.setAdcRange(1024); //1024 for 10bit ADC;4096 for 12bit ADC
gravityTds.begin(); //initialization
}
void loop()
{
//temperature = readTemperature(); //add your temperature sensor and read it
gravityTds.setTemperature(temperature); // set the temperature and execute temperature compensation
gravityTds.update(); //sample and calculate
tdsValue = gravityTds.getTdsValue(); // then get the value
Serial.print(tdsValue,0);
Serial.println("ppm");
delay(1000);
}