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

Go to the source code of this file.

Macros

#define MOTOR   5
 The motor is connected to pin 5 on the Arduino. More...
 
#define MOTOR_PWM   240
 The motor power can be set with this definition. More...
 
#define FRONT_ENDSTOP   7
 The front endstop is connected to pin 7 on the Arduino. More...
 
#define BACK_ENDSTOP   8
 The back endstop is connected to pin 7 on the Arduino. More...
 
#define OPEN_TIMEOUT   2000
 Maximum allowed time in ms, to open the front. More...
 
#define CLOSE_TIMEOUT   2000
 Maximum allowed time in ms, to close the front. More...
 

Enumerations

enum  frontState_t { FRONT_UNKNOWN , FRONT_OPEN , FRONT_CLOSE }
 States of the front panel. More...
 

Functions

void motorInit ()
 Initialize the motor. More...
 
void openFront ()
 Open the font. More...
 
void closeFront ()
 Close the font. More...
 

Variables

enum frontState_t frontState
 Store the state of the front panel. More...
 

Macro Definition Documentation

◆ BACK_ENDSTOP

#define BACK_ENDSTOP   8

The back endstop is connected to pin 7 on the Arduino.

Definition at line 47 of file motorControl.hpp.

◆ CLOSE_TIMEOUT

#define CLOSE_TIMEOUT   2000

Maximum allowed time in ms, to close the front.

Definition at line 53 of file motorControl.hpp.

◆ FRONT_ENDSTOP

#define FRONT_ENDSTOP   7

The front endstop is connected to pin 7 on the Arduino.

Definition at line 44 of file motorControl.hpp.

◆ MOTOR

#define MOTOR   5

The motor is connected to pin 5 on the Arduino.

Definition at line 37 of file motorControl.hpp.

◆ MOTOR_PWM

#define MOTOR_PWM   240

The motor power can be set with this definition.

It's range is 0 - 255. 0 means no power 255 is max power.

Definition at line 41 of file motorControl.hpp.

◆ OPEN_TIMEOUT

#define OPEN_TIMEOUT   2000

Maximum allowed time in ms, to open the front.

Definition at line 50 of file motorControl.hpp.

Enumeration Type Documentation

◆ frontState_t

States of the front panel.

Enumerator
FRONT_UNKNOWN 

Front state is unknown( for example at startup ).

FRONT_OPEN 

Front is opened.

FRONT_CLOSE 

Front is closed.

Definition at line 56 of file motorControl.hpp.

Function Documentation

◆ closeFront()

void closeFront ( )

Close the font.

It will try to close the front panel.

Note
If it fails and can't close the front in time, it will stop.
See also
CLOSE_TIMEOUT

Definition at line 116 of file motorControl.cpp.

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

◆ motorInit()

void motorInit ( )

Initialize the motor.

Definition at line 35 of file motorControl.cpp.

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

◆ openFront()

void openFront ( )

Open the font.

It will try to open the front panel.

Note
If it fails and can't open the front in time, it will stop.
See also
OPEN_TIMEOUT

Definition at line 73 of file motorControl.cpp.

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

Variable Documentation

◆ frontState

enum frontState_t frontState
extern

Store the state of the front panel.

Definition at line 33 of file motorControl.cpp.