I am doing a project using the boebot, and I am wondering how to make it move randomly - just in general, how to make the bot do random movements. if there is code, where can i get it?
· I'm not aware of any RANDOM code, but if you understand how the RANDOM command works you could use it to affect the BOE-Bots direction in one of two ways.· First you could directly randomize the PULSOUT values going to the servo motors.· That would be interesting (the effect).· Another thing is the forward, backup and turn routines could be randomly called, based on a random number.· Just a couple of ideas.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support csavage@parallax.com
Maybe you could use a light dependant resistor (CDS cell) and an a/d input to generate a 'random' number based on the light hitting the cell when the test is made... You could design the thing to seek (photovore) or avoid (photophobe) light if you wished...
One thing to be aware of when running RANDOM stuff with a servo is timing.· You need to be sure your changes don't happen too abruptly or the servo may never reach the position it was heading for when it receives the new changes.· This can cause all kinds of weird symptoms.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support csavage@parallax.com
Comments
· I'm not aware of any RANDOM code, but if you understand how the RANDOM command works you could use it to affect the BOE-Bots direction in one of two ways.· First you could directly randomize the PULSOUT values going to the servo motors.· That would be interesting (the effect).· Another thing is the forward, backup and turn routines could be randomly called, based on a random number.· Just a couple of ideas.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com