You have the right idea, but have not executed it quite correctly. The best way would be to make a case statement and pass the boolean into the checker (for lack of a better term). Then you can set the motor speed to whatever amount you wish when it is true, and stop it when it is false.
Here's an image of what I'm talking about
:
The question is talked about more here:
http://www.chiefdelphi.com/forums/sh...ad.php?t=70564