Random number seed


Results 1 to 11 of 11

Threaded View

  1. #6
    Join Date
    Jan 2007
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Random number seed

    Actually the if statements work fine, but I like adding the "Else" statements and "EndIf"s to clean up the code (Thank you Sazer). and comments to clarify the logic behind my code. My real issue is the way the code is now, my code always provides the same sequence of numbers on start up. I need it to be different each time at startup as well as any other time it basically is supposed to randomly flash 1 of 5 different LEDs - 5 times and then stop and wait for B.7 to go high and then star again. So how can I randomly add a seed to the very first iteration of this process. I read some where that you can pull a value from TMRO, so it will give you an initial seed of 0 to 255. Any thoughts?
    Last edited by kwelna; - 24th January 2007 at 03:08.

Similar Threads

  1. Random Numbers
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 18th December 2008, 08:47
  2. Random seed using the ds1307 RTC
    By rookie11 in forum General
    Replies: 7
    Last Post: - 25th November 2007, 20:31
  3. Working with the random number generator
    By kwelna in forum mel PIC BASIC
    Replies: 9
    Last Post: - 16th January 2007, 17:50
  4. Random number results
    By bartman in forum mel PIC BASIC
    Replies: 3
    Last Post: - 9th March 2005, 17:39
  5. more random number questions
    By bartman in forum mel PIC BASIC
    Replies: 1
    Last Post: - 14th November 2004, 17:55

Members who have read this thread : 0

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