-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
65 lines (56 loc) · 1.21 KB
/
main.c
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
/*
* File: main.c
* Author: marcos-bah
*
* Created on July 20, 2021, 9:42 AM
*/
#include<time.h> //necessário p/ função time()
#include <stdlib.h>// necessário p/ as funções rand() e srand()
#include "keypad.h"
#include "lcd.h"
#include "bits.h"
#include "config.h"
#include "ssd.h"
#include "io.h"
#include "pwm.h"
#include <pic18f4520.h>
#include "apostas.h"
#define ON 0x0F
#define L0 0x80
#define L1 0xC0
#define CLR 0x01
void main(void) {
unsigned int tecla = 16;
float tempo;
//configuração do sistema
srand(time(NULL));
pwmInit();
ssdInit();
lcdInit();
kpInit();
lcdCommand(ON);
textInit();
textSaldo();
textInstrutions();
textWait();
for (;;) {
kpDebounce();
if (kpRead() != tecla) {
tecla = kpRead();
if (bitTst(tecla, 7)) { //2
lcdCommand(CLR);
textApostando();
textWait();
}
if (bitTst(tecla, 3)) { //1
lcdCommand(CLR);
textSaldo();
textApostas();
textWait();
}
if (bitTst(tecla, 8)) { //#
lcdCommand(CLR);
}
}
}
}