Wednesday, October 27, 2010

SciBorg finally does challenge 6


The sixth, and forgotten, challenge in the Robot Design Studio class had to do with working with switches and differentiating between edge and level triggered responses. That is, making the robot react as long as a button pressed or only the moment it is pressed. The challenge added another layer by having to control two motors and switches.
The first part was to make motor a (and b) be on when switch one is pressed and off otherwise (this would be level triggered--if the robot senses it's on the 'pressed' or 'not pressed' level, and it reacts). Above is my functioning program.
Here's some proof if you don't believe me.


The second part was to make motor a reverse when switch one is pressed, and likewise for b. The tricky part of this was that the robot has to look for responses from both motors at the same time, and the motor has to remember if it's been pressed or not. Lots of help from P-Berg helped me make a program where the robot reads the sensor and notes if it was pressed before and if it's being pressed now.
The great part about this 'remembering' thing is that it allows the robot to pay attention to both motors in one program. Otherwise, you would need to have to separate programs and instruct the robot to look at them at the same time.



And it worked marvelously!!!

No comments:

Post a Comment