Question: 6. (6 pts) You are developing an EasyCPro program for a robot with two motors and four sensors (two bumper switches and two limit switches)

6. (6 pts) You are developing an EasyCPro program for a robot with two motors and four sensors (two bumper switches and two limit switches) to perform the following tasks: The robot should continue moving until it hits an obstacle. Upon hitting an obstacle (any one of the sensors is activated), it should stop, pause, backup, pause, turn and continue a) Explain what is happening in the code outlined by the red box. b) Fil in the missing code where indicated. #includs "Maint'. void main (void) int limitl; int limit2; int bumperl; in& bumper2; while (1-1) imitl - GetDigitallnput (5); limit2-GetDigitallnput (6): Page 3 of 4 SAN JOS STATE UNIVERSITY E10 Introduction to Engineering bumper! = GetDigitalinput (7); bumper2 GetDigitalnpu (8) if(limit l-l && limit2-=1 && bumper!-I && bumper2-1) SetPWM (1. 255); SetPWM (2, 0); else FILL IN PROGRAM HERE Explain what is happening in the red box here a. b. Write your answer for the missing code ere: SetPWM(1, 127); SetPWM (2, 127); Wait(2000); TO TURN
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
