Last active
January 13, 2022 17:00
-
-
Save loginov-rocks/475e93c029d1173bec8faf8ba5853d02 to your computer and use it in GitHub Desktop.
DIY Connected Espresso Machine: Main Class and Indicators (Part 5) - EspressoMachine Implementation, General Part
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "EspressoMachine.h" | |
EspressoMachine::EspressoMachine(int pumpPin, | |
int boilerPin, | |
int isBoilingPin, | |
int isSteamPin, | |
int togglePin, | |
int _donePin) : pump(pumpPin), | |
boiler(boilerPin, isBoilingPin, isSteamPin), | |
toggle(togglePin) | |
{ | |
// Configure "Done" pin. | |
donePin = _donePin; | |
pinMode(donePin, OUTPUT); | |
digitalWrite(donePin, LOW); | |
} | |
boolean EspressoMachine::getPumpState() | |
{ | |
return pump.getState(); | |
} | |
boolean EspressoMachine::getBoilerState() | |
{ | |
return boiler.getState(); | |
} | |
BoilerTemp EspressoMachine::getBoilerTemp() | |
{ | |
return boiler.getTemp(); | |
} | |
BoilerTemp EspressoMachine::getBoilerTargetTemp() | |
{ | |
return boiler.getTargetTemp(); | |
} | |
ToggleState EspressoMachine::getToggleState() | |
{ | |
return toggle.getState(); | |
} | |
boolean EspressoMachine::getIsDone() | |
{ | |
return isDone; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment