Quiz+5-3

Quiz 5-3:

Your Robot has a touch sensor in front (TOUCH1) and a touch sensor in back (TOUCH2). Write a program that will allow the Robot to go forward until the front sensor is touched. It will then stand still until the back sensor is touched. It will then go forward until the front sensor is touched. Yes it will keep going forward and waiting until the battery runs down. Good Luck :)

task main { while(1) //Infinite Loop :) Keep it Up!!!// //{ // //while(SensorValue(TOUCH1) == 0) //Boogie Forward till hit { motor[motorB] = 50; motor[motorC]= 50; }

while(SensorValue(Touch2) == 0) // Boogie Backward till hit { motor[motorB] = 0; <span style="color: #0000ff; font-family: 'Lucida Sans Unicode','Lucida Grande',sans-serif;">motor[motorC]= 0; <span style="color: #0000ff; font-family: 'Lucida Sans Unicode','Lucida Grande',sans-serif;">} <span style="color: #0000ff; font-family: 'Lucida Sans Unicode','Lucida Grande',sans-serif;">} <span style="color: #0000ff; font-family: 'Lucida Sans Unicode','Lucida Grande',sans-serif;">}