-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreversal-film-scanner.ino
81 lines (65 loc) · 2 KB
/
reversal-film-scanner.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Author: Jakob Vesely
*
* Used Arduino Device: Arduino Nano
* CPU/Bootloader: ATmega 328P (Old Bootloader)
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* My Classes
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "classes/Enums.h"
#include "classes/Logger.h"
#include "classes/IOElements.h"
#include "classes/LCD.h"
#include "classes/PCom.h"
#include "classes/Camera.h"
#include "classes/Scanner.h"
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Defines
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define MAGAZINE_LENGTH 80
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Vars
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
bool button_pressed = false;
Scanner scanner;
LCD lcd;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Setup
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void setup()
{
Serial.begin(9600);
lcd.init();
lcd.displayClear();
scanner.init(MAGAZINE_LENGTH, &lcd);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Loop
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void loop()
{
if (IOElements::getButtonLeft() || IOElements::getButtonRight())
{
if (button_pressed == false)
{
button_pressed = true;
// Start
if (IOElements::getButtonLeft())
{
Logger::debug("Start a new Run");
scanner.prepareRun();
scanner.executeRun();
}
// Reset
if (IOElements::getButtonRight())
{
scanner.resetRun();
}
}
}
else
{
button_pressed = false;
}
}