hi i want to generate 6 numbers between 1 - 49 (1 and 49 include) here is my codes but always give me 0 to all numbers and i don't want 6 possibles the same [i think i will use if and then commands really much ]
i am useing 16f628 in 4 MHz and LCD=16x2
'''''''''''''''''the codes'''''''''''''''''''''''
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 3
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50
pause 200
sayi1 var word
sayi2 var word
sayi3 var word
sayi4 var word
sayi5 var word
sayi6 var word
b1 var byte
b1=0
tus_bekle:
button porta.4 ,0,0,0,b1,1,tus_geldi
goto tus_bekle
tus_geldi
random sayi1
random sayi2
random sayi3
random sayi4
random sayi5
random sayi6
sayi1 =sayi1 & $31
sayi2 =sayi2 & $31
sayi3 =sayi3 & $31
sayi4 =sayi4 & $31
sayi5 =sayi5 & $31
sayi6 =sayi6 & $31
lcdout $fe,1
lcdout "NUMARALARINIZ"
LCDOut $Fe,$C0
LCDOUT #sayi1,":",#sayi2,":",#sayi3,":",#sayi4,":",#sayi5 ,":",#sayi6
end
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''
Asking is not a shame but not learning is a SHAME!!!
Bookmarks