Search Results - MEL PICBASIC Forum


Search:

Type: Posts; User: Melanie; Keyword(s):

Search: Search took 0.01 seconds.

  1. Replies
    43
    Views
    24,797

    Right... but what's the point? As if anyone's...

    Right... but what's the point? As if anyone's going to even remember 256 combinations.
  2. Replies
    43
    Views
    24,797

    Yes you can do as per your example, as long as...

    Yes you can do as per your example, as long as your RANDOM statement uses W0 (or it's assigned name).
  3. Replies
    43
    Views
    24,797

    No it won't crash... you'll just ignore the upper...

    No it won't crash... you'll just ignore the upper 8 bits... it'll work like this...

    The first column is initial EEPROM Contents, the second column is after you've added 23 (remember 23 is just an...
  4. Replies
    43
    Views
    24,797

    I'm on the run today, so ultra-fast replies... ...

    I'm on the run today, so ultra-fast replies...

    * Program starts for the evening for the first time ever:

    Read 0,B0

    (B0 now contains %00000000 as it has not had anything wrote to it yet)
    ...
  5. Replies
    43
    Views
    24,797

    +23 is just an ODD number. You can have any ODD...

    +23 is just an ODD number. You can have any ODD number here - even ONE. If you use an even number, you will not have 256 random seedings, but 128. I'll leave you to figure why.

    If W0 is made up...
  6. Replies
    43
    Views
    24,797

    If you enter RANDOM with the same number (be it...

    If you enter RANDOM with the same number (be it zero or otherwise) it will always produce the same repeatable sequence.

    If you had your five projects, all identical, all powered up on the same day...
  7. Replies
    43
    Views
    24,797

    Random works thus... You provide RANDOM with a...

    Random works thus...

    You provide RANDOM with a WORD variable, the contents of which is a number anywhere between 0-65535. This number is your 'seed'.

    When RANDOM executes it performs an...
  8. Replies
    43
    Views
    24,797

    I keep forgetting that not everyone has PBP... ...

    I keep forgetting that not everyone has PBP...

    Unfortunately not having PBC I'm relying on the manual only...

    RandomSeed is W0
    I don't know if B0 or B1 is the Lowbyte... let's say it's B0...
  9. Replies
    43
    Views
    24,797

    Lets set this piece by piece. 1. RandomSeed in...

    Lets set this piece by piece.

    1. RandomSeed in my FINAL example is a WORD (16 bits) because the RANDOM command works on a Word variable, so we need a WORD.

    2. RandomSeed.Lowbyte only acts on...
  10. Replies
    43
    Views
    24,797

    Ignore my first example - it's actually...

    Ignore my first example - it's actually unnescessarily complicated. Chosing the second example only...

    Pic Powers Up and executes this code...

    RandomSeed var WORD
    LightSelector var BYTE
    ...
  11. Replies
    43
    Views
    24,797

    Actually, here's a real easy way to get a fresh...

    Actually, here's a real easy way to get a fresh seed for your Random function every time you power up... no description... see if you can figure it...

    RandomSeed var Byte

    PIC powers up and runs...
  12. Replies
    43
    Views
    24,797

    OK, so lets assume you fill all your EEPROM...

    OK, so lets assume you fill all your EEPROM starting from location 1 to the end (let's pretend its address 127) with a Random sequence of Numbers from 1 to 16... EEPROM address zero is reserved.
    ...
  13. Replies
    43
    Views
    24,797

    How often does the PIC get turned on? Each...

    How often does the PIC get turned on? Each evening, or every time the lady of the house strips off to jump in the pool, or... ?

    Your 555 is total overkill.
  14. Replies
    43
    Views
    24,797

    You've got 16 lights you want to randomly switch....

    You've got 16 lights you want to randomly switch.

    Chose a PIC with EEPROM. Fill the EEPROM with a random selection of numbers, and you're away. Nobody's ever going to guess you're recycling a...
  15. Replies
    43
    Views
    24,797

    The easiest and simplest way to start with a...

    The easiest and simplest way to start with a Random Number seed is to employ the services of the User (unbeknown to them of course).

    If you have an On/Off BUTTON, then the PIC powers up very...
Results 1 to 15 of 15