Updated Arduino Bowel Gauge Sketch
Reference: Arduino Bowel Gauge


 // Bowel Gauge _ @TVMiller
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int ssr;
int sensorstart = 0;

void calibrate() {
for (int x=0, x<10; x++) {
lcd.setCursor(0, 0);
lcd.print("Calibrating...");
ssr = analogRead(A0);
sensorstart = sensorstart + ssr;
delay(100);
}
sensorstart = sensorstart / 10; // Average
lcd.clear();
}

void setup()
{
lcd.begin(16, 2);
lcd.clear();
calibrate();
}

void loop()
{
int sensorlive = analogRead(A0); // Live reading
int dif = (sensorlive - sensorstart); // Subtract calibrated reading
float difsol = dif * 0.191; // Variance to fl oz per 40 oz
float difoz = difsol * 1.0425; // Convert fluid to solid ounces

if (difoz < 0) {
lcd.setCursor(0, 0);
lcd.print("0.00"); // Remove negative fluctuations
} else {
lcd.setCursor(0, 0);
lcd.print(difoz); // Print OZ
}

lcd.setCursor(6, 0); lcd.print("OZ");
lcd.setCursor(11, 0); lcd.print("BOWEL");

lcd.setCursor(0, 1);
lcd.print(millis()/1000); // Print SEC

lcd.setCursor(6, 1); lcd.print("SEC");
lcd.setCursor(11, 1); lcd.print("GAUGE");

delay(100);
}


Amity
To regard an adversary with civility is to volunteer tolerance
of their influence upon your community, a treasonous act.
#Project47 @TVMiller 108-074

Opinions Are Like Ass Holes
Mine are well rounded.



Last PageTopNext Page