Viking Skull Lamp
V1.0.1
Loading...
Searching...
No Matches
motorControl.hpp
Go to the documentation of this file.
1
/*
2
* Created on May 28 2022
3
*
4
* Copyright (c) 2022 - Daniel Hajnal
5
* hajnal.daniel96@gmail.com
6
* This file is part of the Viking Skull Lamp project.
7
* Modified 2022.06.27
8
*/
9
10
/*
11
MIT License
12
Copyright (c) 2022 Daniel Hajnal
13
Permission is hereby granted, free of charge, to any person obtaining a copy
14
of this software and associated documentation files (the "Software"), to deal
15
in the Software without restriction, including without limitation the rights
16
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
copies of the Software, and to permit persons to whom the Software is
18
furnished to do so, subject to the following conditions:
19
The above copyright notice and this permission notice shall be included in all
20
copies or substantial portions of the Software.
21
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
SOFTWARE.
28
*/
29
30
#ifndef MOTOR_CONTROL_HPP__
31
#define MOTOR_CONTROL_HPP__
32
33
#include "Arduino.h"
34
#include "
globalResources.hpp
"
35
37
#define MOTOR 5
38
41
#define MOTOR_PWM 240
42
44
#define FRONT_ENDSTOP 7
45
47
#define BACK_ENDSTOP 8
48
50
#define OPEN_TIMEOUT 2000
51
53
#define CLOSE_TIMEOUT 2000
54
56
enum
frontState_t
{
57
58
FRONT_UNKNOWN
,
59
FRONT_OPEN
,
60
FRONT_CLOSE
61
62
};
63
65
void
motorInit
();
66
72
void
openFront
();
73
79
void
closeFront
();
80
82
extern
enum
frontState_t
frontState
;
83
84
#endif
globalResources.hpp
closeFront
void closeFront()
Close the font.
Definition:
motorControl.cpp:116
frontState
enum frontState_t frontState
Store the state of the front panel.
Definition:
motorControl.cpp:33
motorInit
void motorInit()
Initialize the motor.
Definition:
motorControl.cpp:35
openFront
void openFront()
Open the font.
Definition:
motorControl.cpp:73
frontState_t
frontState_t
States of the front panel.
Definition:
motorControl.hpp:56
FRONT_OPEN
@ FRONT_OPEN
Front is opened.
Definition:
motorControl.hpp:59
FRONT_CLOSE
@ FRONT_CLOSE
Front is closed.
Definition:
motorControl.hpp:60
FRONT_UNKNOWN
@ FRONT_UNKNOWN
Front state is unknown( for example at startup ).
Definition:
motorControl.hpp:58
Software
include
motorControl.hpp
|
|
|
© 2021-2022 Daniel Hajnal
|
Viking Skull Lamp V1.0.1
| Generated by:
on Sun Oct 16 2022
|
|
|
© 2021-2022 Daniel Hajnal
|
Viking Skull Lamp V1.0.1
| Generated by:
on Sun Oct 16 2022