Skip to content

Instantly share code, notes, and snippets.

@loginov-rocks
Created January 8, 2022 19:13
Show Gist options
  • Save loginov-rocks/5bcba13a50df0c58ede9b2d18fece709 to your computer and use it in GitHub Desktop.
Save loginov-rocks/5bcba13a50df0c58ede9b2d18fece709 to your computer and use it in GitHub Desktop.
DIY Connected Espresso Machine: Main Class and Indicators (Part 5) - EspressoMachine Header
#ifndef EspressoMachine_h
#define EspressoMachine_h
#include "Relay.h"
#include "Boiler.h"
#include "Toggle.h"
class EspressoMachine
{
private:
Relay pump;
Boiler boiler;
Toggle toggle;
int donePin;
EspressoMachineCommand lastCommand = EspressoMachineCommand::Off;
boolean isCommandChanged = false;
boolean isDone = false;
void setCommand(EspressoMachineCommand);
void operateDone();
public:
EspressoMachine(int, int, int, int, int, int);
// Components getters.
boolean getPumpState();
boolean getBoilerState();
BoilerTemp getBoilerTemp();
BoilerTemp getBoilerTargetTemp();
ToggleState getToggleState();
// Getters.
EspressoMachineCommand getCommand();
boolean getIsCommandChanged();
boolean getIsDone();
// Commands.
boolean command(EspressoMachineCommand);
// Processors.
void work();
};
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment