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 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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started