public double GAS_Calibration() { double val = 0; for (int i = 0; i < CALIBRATION_SAMPLE_TIME; i++) { val += MQResistanceCalculation(a.ReadVoltage()); Thread.Sleep(CALIBRATION_SAMPLE_INTERVAL); } val = val / CALIBRATION_SAMPLE_TIME; val = val / R0_CLEAR_AIR_FACTOR; return(val); }
public double read() { this.oldValue = this.value; this.value = this.convert(input.ReadVoltage()); DisplayLCD.addMeasure(this, this.value); Debug.Print("Published name: " + this.name + " value: " + this.value); return(this.value); }
void timer_Tick(GT.Timer timer) { Double voltaje = entrada.ReadVoltage(); Debug.Print("Voltaje: " + entrada.ReadVoltage()); if (voltaje < 1) { //Estado = ESTADO.CAPTURAR; if (!tip) { ObjectOn(); tip = true; } } else { //Estado = ESTADO.MONITOREANDO; ObjectOff(); tip = false; } }