-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSerial.cpp
78 lines (55 loc) · 1.25 KB
/
CSerial.cpp
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
#include <Esplora.h>
#include <TFT.h>
#include <SPI.h>
#include "CSerial.h"
/**
* @brief CSerial class constructor
*
* @param Lets object know its position in the order of modules
*/
CSerial::CSerial (int posGiven){
positionBomb = posGiven;
solved = true;
selectedSerial = random (0,6);
}
/**
* @brief Function to check whether serial code contains vowel
*
* Every odd combinations contains vowel.
*
*/
bool CSerial::hasVowel (void) {
if (selectedSerial % 2)
return false;
else
return true;
}
/**
* @brief Function to check whether serial code's last number is odd
*
*/
bool CSerial::lastOdd (void){
if (selectedSerial == 0 || selectedSerial == 4 || selectedSerial == 5)
return true;
else
return false;
}
/**
* @brief Function that displays the entire module to user
*
*/
void CSerial::showModule (void){
EsploraTFT.stroke(255,255,255);
EsploraTFT.setTextSize(2);
EsploraTFT.text(serialNumberArray[selectedSerial], 25, 65);
}
bool CSerial::pushSymbol(){}
/**
* @brief Functions for movement across displayed keypads
*
* No movement within this module
*/
void CSerial::moveLeft(void){}
void CSerial::moveRight(void){}
void CSerial::moveDown(void){}
void CSerial::moveUp(void){}