Hello people of the forums, i am having great difficulty trying to generate a random number between 1 and 8, all the examples on the forum i haven't been able to get my head around.. i am a nano28x owner. could somebody please provide me with an example or a direction to head in.
Thanks
this is my current code
Code:
x var long
y var long
x1 var long
y1 var long
main
x = 3
x = random x
x1 = (x/(65535/8))
x1 = x1.lowbyte
y = 3
y = random y
y1 = (y/(65535/8))
y1 = y1.lowbyte
shiftout p0, p2, fastmsbpre, [y1\8, x1\8] 'first value is row second column
pulsout p1,1
goto main
it is shifting out to cascading shiftregisters driving an led matrix