BS1 Random number from 1000 to 3999
Billry1
Posts: 4
Using only the BS1 chip, what statements are needed to generate a random number from 1000 up to 3999?
THANKS!
THANKS!
Comments
To get a pseudo-random number in the range you wanted, you'd do:
RANDOM variable
variable = variable // 3000 + 1000
You'll need some other statements to make a complete program and display the results, but you'll need to look at the DEBUG statement description and a description of how to define variables from the Stamp Manual (Basic Stamp Syntax and Reference Manual). You'll also need to look at the GOTO statement and how to define labels. The "What's a Microcontroller?" tutorial is a good reference for starting to program. It should be in the Editor's help files or you can download it from Parallax.