Mj7,
Da i tebi odgovorim, onaj tvoj kod (ispod)radi kad sam prevezao displeje pocevsi sa rb0.
Samo kad biras broj cifre se jako brzo menjaju kad se drzi stisnut taster tako da je gotovo nemoguce izabrati tano neku jedino ako tise neposreci da se zaustavi na toj u trenutku pustanja tastera.Koliko sam gledao one komande trebalo bi povecati "delay" tastera jel? Inace start,stop i pauza rade samo sto nema ocitavanja tj promena broja na displeju kad davac da signal na ulaz rc0
Code:
'****************************************************************
'* Name : UNTITLED.BAS *
'* Author : NELE *
'* Notice : Copyright (c) 2010 fu*k copyright *
'* : All Rights Reserved *
'* Date : 9/26/2010 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
b0 var byte
jedinice var byte
desetice var byte
stotine var byte
brojac var word
zadatibr var word
maskiranacifra var byte
i var byte
temp var bit
TRISA=%111111
TRISB=0
TRISC=%00000001
ADCON1=7
b0=0
brojac=0
temp=0
main:
Button porta.3,0,1,1,B0,1,uvecajjedinice
Button porta.4,0,1,1,B0,1,uvecajdesetice
Button porta.5,0,1,1,B0,1,uvecajstotine
Button porta.0,0,1,1,B0,1,start
goto prikazibr
goto main
uvecajjedinice:
jedinice=jedinice+1
if jedinice>9 then jedinice=0
b0=0
zadatibr = jedinice + desetice*10 + stotine *100
goto prikazibr
uvecajdesetice:
desetice=desetice+1
if desetice>9 then desetice=0
b0=0
zadatibr = jedinice + desetice*10 + stotine *100
goto prikazibr
uvecajstotine:
stotine=stotine+1
if stotine>9 then stotine=0
b0=0
zadatibr = jedinice + desetice*10 + stotine *100
goto prikazibr
prikazibr:
for i = 0 to i = 4 step 1 ;da bi se cifre bolje videle :)
lookup jedinice,[$3F,$06,$5B,$4F,$66,$6D,$7D,$07,$7F,$6F],maskiranacifra
portb = maskiranacifra
high portc.5
pause 1
low portc.5
lookup desetice,[$3F,$06,$5B,$4F,$66,$6D,$7D,$07,$7F,$6F],maskiranacifra
portb = maskiranacifra
high portc.6
pause 1
low portc.6
lookup stotine,[$3F,$06,$5B,$4F,$66,$6D,$7D,$07,$7F,$6F],maskiranacifra
portb = maskiranacifra
high portc.7
pause 1
low portc.7
NEXT i
goto main
start:
if brojac<zadatibr then
high portc.4
else
low portc.4
goto main
endif
if portc.0 = 0 AND temp = 1 then brojac = brojac +1
if portc.0 = 1 then temp = 1
if portc.0 = 0 then temp = 0
Button porta.2,0,1,1,B0,1,pauza
Button porta.1,0,1,1,B0,1,stopp
b0=0
goto start
pauza:
low portc.4
Button porta.0,0,1,1,B0,1,start
Button porta.1,0,1,1,B0,1,stopp
b0=0
goto pauza
stopp:
low portc.4
b0=0
brojac=0
goto main
end
[Ovu poruku je menjao pesakms dana 30.09.2010. u 00:07 GMT+1]