Question: Please answer all parts and fully explain! Below is the Sample Sumo Bot Code using arduino programming. The Example Code is: // Attach QRE sensors

Please answer all parts and fully explain! Below is the Sample SumoPlease answer all parts and fully explain! Below is the Sample Sumo Bot Code using arduino programming.

The Example Code is:

// Attach QRE sensors #define QRE_FL 9 // Front left QRE sensor labeled QRE_FL #define QRE_FR 8 // Front right QRE sensor labeled QRE_FR int QRE_threshold; // // Attach servomotors #include // Include servo library Servo servo_L; // Define left servomotor Servo servo_R; // Define right servomotor void setup() { Serial.begin(9600); servo_L.attach(13); servo_R.attach(12); } void loop() { int QRE_Value_FL = readQRE_FL(); int QRE_Value_FR = readQRE_FR(); QRE_threshold = 1000; Serial.println("Front Left QRE:"); Serial.println(QRE_Value_FL); Serial.println("Front Right QRE:"); Serial.println(QRE_Value_FR);

if (QRE_Value_FL

{ Serial.println("Reverse"); servo_L.writeMicroseconds(180); servo_R.writeMicroseconds(0); delay(1500); } else if (QRE_Value_FL QRE_threshold) { Serial.println("Turn Right"); servo_L.writeMicroseconds(180); servo_R.writeMicroseconds(180); delay(150); } else (QRE_Value_FL > QRE_threshold && QRE_Value_FR

} else { Serial.println("Go Forward"); servo_L.writeMicroseconds(0); servo_R.writeMicroseconds(180); delay(100); } } int readQRE_FL() { pinMode( QRE_FL, OUTPUT ); digitalWrite( QRE_FL, HIGH ); delayMicroseconds(10); pinMode( QRE_FL, INPUT ); long time = micros(); while (digitalRead(QRE_FL) == HIGH && micros() - time

(4) Please identify the following within the sumo bot code: (a) What digital pin is connected to QRE_FL? (b) What is the variable name for the left servomotor? (c) How many sensors are being used? (d) What digital pin is attached to the left servomotor? (e) Within each loop, write what the output is to the serial monitor... just as it would appear to you on your computer screen. (f) What is the maximum time that one instance of the loop will keep its motors turned on? (g) What is the minimum time that one instance of the loop will keep its motors turned on? (4) Please identify the following within the sumo bot code: (a) What digital pin is connected to QRE_FL? (b) What is the variable name for the left servomotor? (c) How many sensors are being used? (d) What digital pin is attached to the left servomotor? (e) Within each loop, write what the output is to the serial monitor... just as it would appear to you on your computer screen. (f) What is the maximum time that one instance of the loop will keep its motors turned on? (g) What is the minimum time that one instance of the loop will keep its motors turned on

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!