Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. You are developing an EasvCPro program for a robot with two motors and four sensors (two bumper switches and two limit switches) to perform

image text in transcribed

1. You are developing an EasvCPro 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) b) Explain what is happening in the code outlined by the red box. Fill in the missing code where indicated. include "Mainh" void main (void) int limitl int limit2 int bumperl int bumper.2 while (1-1) limitl-GetDigitalInput (5); limit2- GetDigitalInput (6); bum perl = GetDigitalinput (7); = GetDigitalinp if limitl--1 && limit2-1&& bumperl-1 && bumper2-1) SetPWM (1, 127); SetPWM (2, -127); else FILL IN PROGRAM HERE Explain what is happening in the red box here b. Write your answer for the missing code ere: a

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions