Skip to content

Commit ff7a7eb

Browse files
author
Brandon Satrom
authored
Merge pull request #33 from bsatrom/feature/fermentation-time
display fermentation time; closes #29
2 parents 42cb7f9 + 44f4695 commit ff7a7eb

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

brew-buddy-firmware/src/brew-buddy-firmware.ino

+12-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void loop()
150150
tft.setTextColor(ILI9341_WHITE);
151151

152152
displayFermentationHeading();
153-
// TODO: print delta btw mode start and fermentation start
153+
displayFermentationModeDelta();
154154

155155
waitUntil(Particle.connected);
156156
Particle.publish("fermentation/state", "start");
@@ -418,12 +418,22 @@ void displayStageName(String stagename)
418418

419419
void displayFermentationHeading()
420420
{
421-
tft.setCursor(0, 40);
421+
tft.setCursor(0, 100);
422422
tft.setTextSize(2);
423423
tft.println("Fermentation Rate");
424424
tft.println("(in seconds)");
425425
}
426426

427+
void displayFermentationModeDelta()
428+
{
429+
unsigned long fermentationDelta = fermentationStartTime - fermentationModeStartTime;
430+
431+
tft.setCursor(0, 40);
432+
tft.setTextSize(2);
433+
tft.println("Time to fermentation (hours)");
434+
tft.println(fermentationDelta / 36000000.00);
435+
}
436+
427437
void displayTimeHeading()
428438
{
429439
tft.setCursor(0, 120);

0 commit comments

Comments
 (0)