6 random numbers limiting to 49 ?????


Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    May 2005
    Posts
    49

    Default 6 random numbers limiting to 49 ?????

    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
    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''
    Attached Images Attached Images  
    Asking is not a shame but not learning is a SHAME!!!

Similar Threads

  1. Questions on random numbers and multiplexing LEDs
    By AaronM in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th June 2009, 04:22
  2. Replies: 4
    Last Post: - 15th April 2009, 01:54
  3. Random Numbers
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 18th December 2008, 08:47
  4. Real Time Clock & Eeprom
    By smart_storm in forum General
    Replies: 8
    Last Post: - 17th February 2006, 19:03
  5. Output PIC module
    By freelancebee in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th September 2005, 20:10

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts