Any very basic way to randomly select a number between 1 and 4096 with spin
AndyProp
Posts: 60
in Propeller 1
What i am looking for is a very basic number generator that returns a number between 1 and 4096
Does not need to be very random, just the most simple way to get some numbers, even if they come up multiple times or consecutively.
Comments
If you are using spin, check the RND instruction.
Something like that:
Ariba,
Brilliant idea of using CNT.
Reminds me of the Apple II using the time between keyboard presses as a Random Number.
CNT at the beginning of the program is not a good source of randomness. If you're loading over serial, it will have a semi-random value, but when loading from EEPROM, it is always(?) the same
Brilliant, thanks a lot.