Wednesday, November 1, 2017

Module 10

Module 10


Touch Sensor:

Charlie programmed the touch sensor so it spun the main motor whenever it was activated. This program was very simple and include a loop. At the start the button would activate the loop and at the end of each cycle the robot would ask itself if the button was still activated, if it was it would keep looping, if it wasn't the program would end.








Move Steering with Touch Sensor:


We programmed the steering into the previous code so that during the loop the robot also told itself to move, turning left and then turning back to the right. Like before, the robot continues the loop if the button is pressed and held but if the button isn't held then it only cycles through once.









Color Sensor:


In the same programming as before we added a switch that the color sensor would activate and depending on the color that it sensed it would create an output. So for our color we picked red, and when the progam saw it was red then the robot made a hissing noise.







IR Sensor:


We created an independent code including a switch and a loop that determines if there is something in the way of the sensor. If there is something detected in front of the sensor the robot makes a noise.













No comments:

Post a Comment