Week 8
Testing of the RCX code.
Now that the full set of lego mindstorm(so gonna get one for myself on christmas) is finally in place, and we have every component in it.
We can get down to work, since I"m not very good at designing and drafting out ideas, I decided to concentrate on the coding need for the cambot to run.
Now we've zero it down to a few things in which the cambot has to be able to do while moving around.
1. Follow a standard path
2. Not go too close to the person
3. Be able to either aviod/move around objects which it bumps into
Instead of going straight into the RCX coding or VB coding, I've decided to document my "code to be" as a flow chart, which can be submitted in a documentation later on in the development process.
Since the RCX code can support up to 9 sensor watch stacks at a time and listen to 9 different inputs, this makes my job a little easier.
Stack 1 on start program, on output A nd C(which sets the wheels to run)
Stack 2:(this stack contorls the cambot to follow the path or in this case a light source)
if light is on then
on output A and C
else if light is off
off output A and C
Stack 3 and 4:(these will be the touch sensors which cause the cambot to move around objects 3 is the right sensor and 4 is the left)
if sensor is true then
off output A and C
on reverse A and C
off output A(by only having one wheel move, will cause the cambot to turn)
move A at normal speed
move C at high speed (causing cambot to turn back to its original direction)
wait for 1 second (waiting here causes the code to wait, but the cambot will carry on moving)
(the 1 second wait here is for the cambot to fully turn before continuing on its path)
set speed of C to normal speed (this will cause the cambot to move straight again)
The code has yet to be tested, as this is only the planning stage, certain features must still be added, and considerations like what if it bangs into a wall, there will be no point in move it then, can it be turned off...etc
What happens if there is more than 1 cambot moving around?
so there is still quite a lot of thing to build on from here.

0 Comments:
Post a Comment
<< Home