Skip to content

Commit

Permalink
removed analog ref
Browse files Browse the repository at this point in the history
  • Loading branch information
braraki committed Apr 1, 2020
1 parent 73635ec commit 417b4ea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions Pressure.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion e-vent.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 417b4ea

Please sign in to comment.