I want to write PIC program which involves this situation: Generating random number from specific range of numbers.
For example if range is 300 - 900, then the random number generator will only pick up number from that range.
I saw in basic that there is function called RANDOM which generates number between 1-65k and does not restrict to a specified range.
If anyone has any hints, I'll appreciate it very much.
Thanx.
I want to write PIC program which involves this situation: Generating random number from specific range of numbers.
For example if range is 300 - 900, then the random number generator will only pick up number from that range.
I saw in basic that there is function called RANDOM which generates number between 1-65k and does not restrict to a specified range.
If anyone has any hints, I'll appreciate it very much.
Thanx.
Generate a 16 bit random number (0-65535), divide it by 109 which scales it to (0-600), then add 300 to it. This will give your required 300-900 range.