add relay for ec sensor

This commit is contained in:
interfisch 2023-04-17 21:33:05 +02:00
parent 576860ae31
commit 9e539682e8
1 changed files with 12 additions and 0 deletions

View File

@ -3,6 +3,12 @@
#include <Arduino.h>
#define EC_PIN_RELAY_PROBE 27
#define EC_PIN_RELAY_CALIBRATION 26
#define EC_PIN_RELAY_RANGE 25
#define EC_CALIBRATION_RESISTOR_NC 100000
#define EC_CALIBRATION_RESISTOR_NO 1000
#define EC_PIN_ADC 4
@ -24,6 +30,12 @@ void ec_setup() {
ledcAttachPin(EC_PIN_FREQ, EC_PWM_CH);
ledcWrite(EC_PWM_CH, 127);
pinMode(EC_PIN_RELAY_PROBE,OUTPUT); //LOW=Calibration/idle, HIGH=Probe connected
pinMode(EC_PIN_RELAY_CALIBRATION,OUTPUT); //LOW=NC Calibration Resistor, HIGH=NO Calib. Res.
pinMode(EC_PIN_RELAY_RANGE,OUTPUT); //LOW=NC Range Resistor, HIGH=NO Range Resistor
digitalWrite(EC_PIN_RELAY_PROBE,LOW);
digitalWrite(EC_PIN_RELAY_CALIBRATION,LOW);
digitalWrite(EC_PIN_RELAY_RANGE,LOW);
}
void ec_loop(unsigned long loopmillis, unsigned long pInterval) {