-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
70 lines (63 loc) · 1.41 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
66
67
68
69
70
/*
* main.c
*
* Created: 3/23/2022 8:09:16 PM
* last modification : 4/14/2022 1:49:16 AM
* Author: Mohamed U3
*/
#define F_CPU 12000000UL
#include <xc.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include <stdio.h>
#include "inc/LCD_interface.h"
#include "inc/UART_interface.h"
#include "inc/FP_interface.h"
#include "inc/keys_interface.h"
int main()
{
UART_InterrptInit(57600);
lcdbegin();
keys_init();
lcdclear();
lcdprint("Loading.. ");
_delay_ms(500);
sendcmd2fb(FB_connect);
_delay_ms(500);
unsigned char options_conter = 0;
lcdclear();
while(1)
{
lcdfirstrow();
lcdprint("Options: ");
lcdwrite(0x7f,DATA);
lcdwrite(0x7e,DATA);
if(keys_Feedback() == keys_up)
options_conter++;
else if(keys_Feedback() == keys_down)
options_conter--;
else if(keys_Feedback() == keys_ok)
{
if(options_conter == 0)
Search();
else if(options_conter == 1)
enroll();
else if(options_conter == 2)
sendcmd2fb(F_delete);
else if(options_conter == 3)
sendcmd2fb(FP_empty);
}
if(options_conter > 3)
options_conter = 0;
lcdsecondrow();
if(options_conter == 0)
lcdprint("-Scan ");
else if(options_conter == 1)
lcdprint("-Enroll ");
else if(options_conter == 2)
lcdprint("-Delete ID ");
else if(options_conter == 3)
lcdprint("-Erase IDs ");
_delay_ms(100);
}
}