Plenty of ideas, but nothing you cannot get by just looking in the Help at the RND function, plus how to set a port for output and set a bit within the port.
Suppose you want to use portX, bit Y as output. Then something like this would work:
[code:1:fa35351150]
config portX.Y as output 'set port line for output
dim wrandom as word 'define a word variable
dim btemp as byte 'and a byte
do 'loop forever
wrandom = rnd(256) 'generate random number in range 0-255
portX.Y = wrandom.0 'assign bit 0 from number to port pin
loop
[/code:1:fa35351150]
↧