-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuProg21.py
More file actions
83 lines (66 loc) · 1.83 KB
/
uProg21.py
File metadata and controls
83 lines (66 loc) · 1.83 KB
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
82
83
from lib import LCD, Teclado
from time import sleep_ms
# Calculadora de comida
# ** Gorditas 17
# ** Molletes 10
# ** Tacos 60
# ** Boing 16
lcd = LCD(0,1,2,[3,4,5,6,7,8,9,10])
t = Teclado([11,12,13,14],[15,16,17,18],'123A456B789C*0#D$')
def menu():
lcd.textox( 0, 'A-Gordi')
lcd.textox( 8, 'B-Molle')
lcd.textox(64, 'C-Tacos')
lcd.textox(72, 'D-Boing')
lcd.cursor(False, False)
gorditas = 0
molletes = 0
tacos = 0
boing = 0
while True:
tecla = t.lee()
if tecla=='A':
lcd.limpia()
lcd.texto('Gorditas: ' + str(gorditas))
lcd.cursor(True, False)
gorditas = t.leeEntero(gorditas,68,2,lcd)
menu()
if tecla=='B':
lcd.limpia()
lcd.texto('Molletes: ' + str(molletes))
lcd.cursor(True, False)
molletes = t.leeEntero(molletes,68,2,lcd)
menu()
if tecla=='C':
lcd.limpia()
lcd.texto('Tacos: ' + str(tacos))
lcd.cursor(True, False)
tacos = t.leeEntero(tacos,68,2,lcd)
menu()
if tecla=='D':
lcd.limpia()
lcd.texto('Boing: ' + str(boing))
lcd.cursor(True, False)
boing = t.leeEntero(boing,68,2,lcd)
menu()
if tecla=='#':
cuenta = gorditas*17+molletes*10+tacos*60+boing*16
lcd.limpia()
lcd.textox(0,'G ' + str(gorditas))
lcd.textox(4,'M ' + str(molletes))
lcd.textox(8,'T ' + str(tacos))
lcd.textox(12,'B ' + str(boing))
lcd.textox(66,'Cuenta: ' + str(cuenta))
while True:
if t.lee()=='#':
break
menu()
if tecla=='*':
gorditas = 0
molletes = 0
tacos = 0
boing = 0
lcd.limpia()
lcd.textox(0,'Nueva cuenta...')
sleep_ms(2000)
menu()