Viking Skull Lamp  V1.0.1
Loading...
Searching...
No Matches
fogMachine.cpp File Reference
#include "fogMachine.hpp"

Go to the source code of this file.

Functions

void fogMachineInit ()
 Initialize the fog machine( humidifier ). More...
 
void fogMachineUpdate ()
 Update the fog machine state. More...
 
void fogMachineEnable ()
 Enable the humidifier. More...
 

Variables

unsigned long fogMachineTimer = 0
 This variable is used for automatic humidification. More...
 
unsigned long fogLastTurnOn = 0
 This variable stores the last system time when the humidifier was turned on by any reason. More...
 
unsigned long fogCoolDownTimer = 0
 This variable stores the last system time when the cool down event happened. More...
 
bool fogCoolDown = false
 If the cool down procedure still in progress, this flag will be true. More...
 

Function Documentation

◆ fogMachineEnable()

void fogMachineEnable ( )

Enable the humidifier.

This function turns on the humidifier if:

  1. The humidifier is turned off
  2. And the cool down time has expired.

Definition at line 167 of file fogMachine.cpp.

Here is the caller graph for this function:

◆ fogMachineInit()

void fogMachineInit ( )

Initialize the fog machine( humidifier ).

Definition at line 50 of file fogMachine.cpp.

Here is the caller graph for this function:

◆ fogMachineUpdate()

void fogMachineUpdate ( )

Update the fog machine state.

This function should be called periodically. It handles the state machine of the humidifier. The humidifier module can not work for a long period of time with dry tank, because it will overheat. We doesn't have any sensor to monitor the liquid level in the tank, so I implemented the simplest solution:

  1. The humidifier can be operated for a short amount of time. It is specified in HUMIDIFIER_DURATION
  2. After this time has elapsed it has to be turned off and let it cool at least for some time. It is specified in HUMIDIFIER_COOL_DOWN
  3. It can not turned on until the cool down time has expired.

Also if the humidifier is enabled for periodic humidification we have to calculate when to start the automatic humidification next.

Definition at line 57 of file fogMachine.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ fogCoolDown

bool fogCoolDown = false

If the cool down procedure still in progress, this flag will be true.

Definition at line 48 of file fogMachine.cpp.

◆ fogCoolDownTimer

unsigned long fogCoolDownTimer = 0

This variable stores the last system time when the cool down event happened.

From this time whe should not turn on the humidifier for HUMIDIFIER_COOL_DOWN duration.

Definition at line 45 of file fogMachine.cpp.

◆ fogLastTurnOn

unsigned long fogLastTurnOn = 0

This variable stores the last system time when the humidifier was turned on by any reason.

Definition at line 39 of file fogMachine.cpp.

◆ fogMachineTimer

unsigned long fogMachineTimer = 0

This variable is used for automatic humidification.

It stores the last system time when the humidifier was turned on by the automated logic.

Definition at line 35 of file fogMachine.cpp.