// Bowel Gauge
// vgmlr
#include "LiquidCrystal.h"
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int sensorstart = 0; // Intial reading
void setup()
{
sensorstart = analogRead(A0); // Store initial reading
lcd.begin(16, 2);
}
void loop()
{
int sensorlive = analogRead(A0); // Live reading
int dif = (sensorlive - sensorstart); // Subtract start reading
float difsol = dif * 0.191; // Variance to fluid ounces per 40 oz measure
float difoz = difsol * 1.0425; // Convert fluid to solid ounces
if (difoz < 0){
lcd.setCursor(0, 0);
lcd.print("0.00"); // Zero fluctuation
} else {
lcd.setCursor(0, 0);
lcd.print(difoz); // Print ounces
}
lcd.setCursor(6, 0);
lcd.print("oz");
lcd.setCursor(11, 0);
lcd.print("Bowel");
lcd.setCursor(0, 1);
lcd.print(millis()/1000); // Seconds
lcd.setCursor(6, 1); lcd.print("sec");
lcd.setCursor(11, 1); lcd.print("Gauge");
delay(1000); // per second
}