#define FC28PIN 35
#define ADC_VREF_mV 5000.0
#define ADC_RESOLUCION 4096.0
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
analogReadResolution(12);
pinMode(FC28PIN, INPUT);
Serial.println("INICIALIZANDO EL SENSOR FC28");
}
void loop() {
//leer el valor analogico del pin donde esta conectado
int adcValue = analogRead(FC28PIN);
// convierte el valor del ADC a milivoltios
float voltage_mV = adcValue * (ADC_VREF_mV / ADC_RESOLUCION );
float humedad = voltage_mV / 10.0;
Serial.print("humedad: ");
Serial.print(humedad, 2);
Serial.println(" %");
// put your main code here, to run repeatedly:
delay(2000); // this speeds up the simulation
}