PDA

View Full Version : Random comand with the 08 motor driver???



wil0107_eiles
14-08-2008, 00:40
Hi just wondering if it is possible to use the random command with the 08 motor driver board??? (i know stupid question!!!) I just cannot get the random command to work with it!!! I have not used picaxe very much before as you have probably already worked out so any help is appreciated!!

this is the code i am trying to use:


main:
if pin3=1 then rand
goto main
rand:
high 1
random b2
pause b2
low 1


Thanks again!

hippy
14-08-2008, 03:43
You need to use a word variable with RANDOM or it will choose only a very limited set of numbers, all of which are so low you probably don't see any effect.

tiscando
17-08-2008, 19:55
This is quite an annoying thing if you have limited number of variables.

random w1
pause b2
'this is much the same, but also touching variable b3, and it works.