bojour a tous voila mon probleme je doit tj faire cette calculatrice et je suis bloqué, je narrive pas a afficher plusieur chiffre ala suite sur mon lcd ex:"1548"+"455"=
je joint le code que j'ai deja fait il n'est pas complet evidement
si quelq'un peux m'aider merci d'avance
define osc 20
define loader_used 1
'définition pour l'afficheur LCD
define lcd_dreg portd
define lcd_dbit 0
define lcd_rsreg portd
define lcd_rsbit 4
define lcd_rwreg portd
define lcd_rwbit 5
define lcd_ereg portd
define lcd_ebit 6
symbol lcd_rw = portd.5
'configuration RB0 (interuption externe clavier)
intcon =$90
symbol intf= intcon.1
'variable
key var byte
key_flag var bit
n1 var byte
n2 var byte
n3 var byte
on interrupt goto isr
i var word
enable
'routine d'initialisation
init: clear
low lcd_rw
pause 500
lcdout $fe, $40,6,9,9,6,0,0,0,0
lcdout $fe, 1
'Boucle principale
main : if (key_flag = 1) then
lookup key,["123+456-789:C0=*"],key
lcdout $fe,$80," ", key
if key = "C" then
gosub init
key_flag = 0
endif
endif
if (key_flag = 1) then
lookup key,["123+456-789:C0=*"],key
lcdout $fe,$80," ", key
if key = "+" then
gosub add
key_flag = 0
endif
endif
if (key_flag = 1) then
lookup key,["123+456-789:C0=*"],key
lcdout $fe,$80," ", key
if key = "-" then
gosub sou
key_flag = 0
endif
endif
if (key_flag = 1) then
lookup key,["123+456-789:C0=*"],key
lcdout $fe,$80," ", key
if key = ":" then
gosub div
key_flag = 0
endif
endif
if (key_flag = 1) then
lookup key,["123+456-789:C0=*"],key
lcdout $fe,$80," ", key
if key = "*" then
gosub mul
key_flag = 0
endif
endif
if (key_flag = 1) then
lookup key,["123+456-789:C0=*"],key
lcdout $fe,$80," ", key
if key = "=" then
gosub sol
key_flag = 0
endif
endif
for i=0 to 9999
pauseus 100
next i
goto main
disable
'sous routine key
isr: if (intf = 1) then
key = portb>>4
key_flag =1
intf = 0
endif
'sous routine d'addition
add: n3 = n1 + n2
return
disable
'sous routine de soustraction
sou: n3 = n1 - n2
return
disable
'sous routine de division
div: n3 = n1 / n2
return
disable
'sous routine de multiplication
mul: n3 = n1 * n2
return
disable
'sous routine de solution
sol: 'n3
return
disable
Resume
Enable