I'm wondering how to effectively generate random numbers with my PICAXE 08M2. The following is my code:
; Inputs
symbol push_red = C.1 ; In 1
symbol push_buzzer = C.3; In 3
; Outputs
symbol buzzer = C.2; Out 2
symbol led_red = C.4;
symbol action = b0
symbol randnum = w5;
symbol randbit = w6;
main:
FOR action = 1 TO 5
RANDOM randnum
LET randbit = randnum // 10
IF randnum > 4 THEN
PAUSE 500
low led_red
pause 500
high led_red
ELSE
SOUND buzzer,(100, 100)
ENDIF
NEXT action
SOUND buzzer,(120, 200)
Even though I'm generating a new random number with every loop, the result is always the same: LEDs light up, no sound generated. I've read some articles about dividing randnum by an appropriate number, but not sure how that works.