From 417b4ead942209f590544ea7e7a537d06d2832e9 Mon Sep 17 00:00:00 2001 From: "br.araki" Date: Tue, 31 Mar 2020 20:45:09 -0400 Subject: [PATCH] removed analog ref --- Pressure.h | 3 +-- e-vent.ino | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Pressure.h b/Pressure.h index 3afff6f..d595531 100644 --- a/Pressure.h +++ b/Pressure.h @@ -21,9 +21,8 @@ class Pressure { float Pmin = -100.0; // pressure max in mbar float Pmax = 100.0; // pressure min in mbar float Vmax = 1024; // max voltage in range from analogRead - float R = 32./37; // Internal 32K resistor and external 5K resistor ratio // convert to pressure - float pres = (10 * V/Vmax * R - 1) * (Pmax-Pmin)/8. + Pmin; //mmHg + float pres = (10 * V/Vmax - 1) * (Pmax-Pmin)/8. + Pmin; //mmHg // convert to cmH20 pres *= 1.01972; diff --git a/e-vent.ino b/e-vent.ino index d726515..1fc0e6e 100644 --- a/e-vent.ino +++ b/e-vent.ino @@ -165,7 +165,6 @@ void setup() { //Initialize pinMode(HOME_PIN, INPUT_PULLUP); // Pull up the limit switch - analogReference(EXTERNAL); // For the pressure and pots reading displ.begin(); setState(PREHOME_STATE); // Initial state roboclaw.begin(38400); // Roboclaw