Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] <

To: <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: EX Robotics Question
From: "Alain Tougas" <alain@xxxxxxx>
Date: Wed, 14 Mar 2007 11:57:34 -0400

Hi Bruce,

Your ?follow the line? algorithm is very clean. If I didn?t know how to do
it already, just reading your code would have been a good explanation, just
by itself.

Well, you figured out that this won?t work:

to relay
waituntil [switch1]
aon con
asetpower 2
csetpower 2
loop [left
waituntil [onblack]
waituntil [not onblack]
right
waituntil [onblack]
waituntil [not onblack]
]
if switch2 [aoff coff]
end

and in many occasions, this won?t work neither:

to relay
waituntil [switch1]
aon con
asetpower 2
csetpower 2
loop[
left
waituntil [onblack]
waituntil [not onblack]
right
waituntil [onblack]
waituntil [not onblack]
if switch2 [aoff coff]
]
end

because you cannot be certain that the ?switch2? test will not be performed
at the right moment.

However, there is ONE instruction that is executed very very often, and that
is NOT compromised by the fact that waituntil really ?jams? the flow of
execution: that?s ONBLACK. Try this:

to onblack
if switch2 [aoff coff]
output reflect2
end

-----Original Message-----
From: mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
[mailto:mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Bruce
Cattanach
Sent: March 14, 2007 10:55 AM
To: mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Cc: Gerard Telmosse; Bruce
Subject: EX Robotics Question

My colleague, working with our 5th grade has this question
dealing with MW ExRobtics...  Thanks

I need a program that will start a robot with a touch
sensor, follow a line and stop the robot with another
touch sensor. So far it can start with a touch sensor and
follow the line. I cannot get another touch sensor to work.

This robot has a touch sensor in the back and front and is triggered from
another robot coming from the back.  After it starts, and follows a line, it
contacts
 a third robot which starts following a line,  the front sensor will trigger
the robot to stop.
 A relay event, with three robots.  All following lines and triggering
others.

I know,  we aren't supposed to be doing this with Fifth graders,
but we just can't help ourselves.  LOL

The program so far is --

to relay
waituntil [switch1]
aon con
asetpower 2
csetpower 2
loop[
left
waituntil [onblack]
waituntil [not onblack]
right
waituntil [onblack]
waituntil [not onblack]
]
end

to left
aon bon coff
end

to right
con bon aoff
end

to onblack
output reflect2
end

any help will be greatly appreciated.

Gerry Telmosse
Science Specialist
www.gtelmosse.com <http://www.gtelmosse.com/>
www.myownbook.tv <http://www.myownbook.tv/>

--
Bruce Cattanach
http://www.cattanach.org <http://www.cattanach.org/>

  • Previous by thread: EX Robotics Question

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2008