Device = 18F458
Xtal = 20
Dim Random_Number as Float
Symbol Min_Val = 5
Symbol Max_Val = 8
Cls
Print At 1, 1, "Number = "
SEED $0345 ' Put the pointer in the middle of the random table.
Main:
Random_Number = Random ' Generate a pseudo-randomisation on Variable.
Random_Number = (Random_Number / 65535) ' Perform The math to create a number from 5 to 8.
Random_Number = Random_Number * (Max_Val - Min_Val) ' Proton only allows upto 3 values per equation,
Random_Number = Random_Number + Min_Val ' thats why they are broken up onto seperate lines.
Print At 1, 10, DEC3 Random_Number ' Display the value on the LCD
DelaymS 250 ' Small delay
Goto Main ' Loop for eve