' ========================================================================= ' ' File....... Random_Outs.BS1 ' Purpose.... ' Author..... Jon Williams -- Parallax, Inc. ' E-mail..... jwilliams@parallax.com ' Started.... ' Updated.... 14 OCT 2005 ' ' {$STAMP BS1} ' {$PBASIC 1.0} ' ' ========================================================================= ' -----[ Program Description ]--------------------------------------------- ' -----[ Revision History ]------------------------------------------------ ' -----[ I/O Definitions ]------------------------------------------------- ' -----[ Constants ]------------------------------------------------------- ' -----[ Variables ]------------------------------------------------------- SYMBOL lottery = W1 SYMBOL idx = B4 ' -----[ EEPROM Data ]----------------------------------------------------- ' -----[ Initialization ]-------------------------------------------------- Reset: DIRS = %00011111 ' make P0-P4 outputs lottery = 1031 ' seed random value ' -----[ Program Code ]---------------------------------------------------- Main: PINS = lottery // 31 + 1 ' 1 - 31 PAUSE 100 FOR idx = 1 TO 3 ' tumble value RANDOM lottery NEXT GOTO Main ' -----[ Subroutines ]-----------------------------------------------------