Hey Darrel...that works a treat ...I've now got pretty twinkly Blue leds randomly flashing before my eyes (which strangely, makes me feel warm inside).
I note that a fair few of the random numbers are the same as the previous (I guess when you've only six to choose from, then that's bound to happen!), so I'll sit down for a few weeks & try & code this out!
Many thanks!
Hank.
Edit: Actually, dialing out the successive repeats only took a couple of minutes...
Code:
MyWord var Word
MyByte var Byte
previous_random var Byte
;---------------------------------------
Main:
Random MyWord
MyByte=(MyWord//6)+1
if previous_random = MyByte then goto Main
GOSUB HIGH_LED
PAUSE 50
GOSUB LOW_LED
PAUSE 50
previous_random = MyByte
GOTO Main
;---------------------------------------
HIGH_LED:
SELECT CASE MyByte
CASE 1 : HIGH LED1
CASE 2 : HIGH LED2
CASE 3 : HIGH LED3
CASE 4 : HIGH LED4
CASE 5 : HIGH LED5
CASE 6 : HIGH LED6
END SELECT
RETURN
;---------------------------------------
LOW_LED:
SELECT CASE MyByte
CASE 1 : LOW LED1
CASE 2 : LOW LED2
CASE 3 : LOW LED3
CASE 4 : LOW LED4
CASE 5 : LOW LED5
CASE 6 : LOW LED6
END SELECT
Bookmarks