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

Go to the source code of this file.

Macros

#define HUMIDIFIER_PIN   6
 The humidifier is connected to pin 6 on the Arduino. More...
 
#define HUMIDIFIER_DURATION   (unsigned long)15000
 Humidifier turn on duration in ms. The humidifier will be turned on for this amount of time. More...
 
#define HUMIDIFIER_COOL_DOWN   (unsigned long)30000
 Humidifier cool down time. The humidifier has to be turned off for this amount of time before turning on again. More...
 

Functions

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

Macro Definition Documentation

◆ HUMIDIFIER_COOL_DOWN

#define HUMIDIFIER_COOL_DOWN   (unsigned long)30000

Humidifier cool down time. The humidifier has to be turned off for this amount of time before turning on again.

Definition at line 44 of file fogMachine.hpp.

◆ HUMIDIFIER_DURATION

#define HUMIDIFIER_DURATION   (unsigned long)15000

Humidifier turn on duration in ms. The humidifier will be turned on for this amount of time.

Definition at line 41 of file fogMachine.hpp.

◆ HUMIDIFIER_PIN

#define HUMIDIFIER_PIN   6

The humidifier is connected to pin 6 on the Arduino.

Definition at line 38 of file fogMachine.hpp.

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: