I need the flowchart of this

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I need the flowchart of this 

#include <HCSR04.h>
UltraSonicDistance Sensor ultrasonic (A0, A1);
float distance;
// left motor
int leftMotor SpeedPin = 3;
int leftMotor ForwardPin = 4;
int leftMotorBackwardPin = 5;
// right motor
int rightMotorSpeedPin = 11;
int rightMotorForwardPin = 12;
int rightMotorBackwardPin = 13;
STEP2.
void setup() {
}
pinMode (leftMotorSpeedPin, OUTPUT);
pinMode (leftMotorForwardPin, OUTPUT);
pinMode (leftMotorBackwardPin, OUTPUT);
pinMode (rightMotor SpeedPin, OUTPUT);
pinMode (rightMotor ForwardPin, OUTPUT);
pinMode (rightMotorBackwardPin, OUTPUT);
Serial.begin(9600);
digitalWrite (leftMotorSpeedPin, HIGH);
digitalWrite (rightMotorSpeedPin, HIGH);
STEP4.
void goForward() {
digitalWrite (leftMotorForwardPin, HIGH);
digitalWrite (leftMotorBackwardPin, LOW);
digitalWrite (rightMotor ForwardPin, HIGH);
digitalWrite (rightMotorBackwardPin, LOW);
}
void goBackward () {
digitalWrite (leftMotor ForwardPin, LOW);
digitalWrite (leftMotorBackwardPin, HIGH);
digitalWrite (rightMotor ForwardPin, LOW);
digitalWrite (rightMotorBackwardPin, HIGH);
}
void stop() {
digitalWrite (leftMotor ForwardPin, LOW);
digitalWrite (leftMotorBackwardPin, LOW);
digitalWrite (rightMotor ForwardPin, LOW);
digitalWrite (rightMotor BackwardPin, LOW);
}
void goRight() {
digitalWrite (leftMotor ForwardPin, HIGH);
digitalWrite (leftMotorBackwardPin, LOW);
digitalWrite (rightMotor ForwardPin, LOW);
digitalWrite (rightMotorBackwardPin, LOW);
}
void goLeft () {
digitalWrite (leftMotorForwardPin, LOW);
digitalWrite (leftMotorBackwardPin, LOW);
digitalWrite (rightMotor ForwardPin, HIGH);
digitalWrite (rightMotor BackwardPin, LOW);
void loop()
STEP3.
distance ultrasonic.measureDistanceCm ();
{
{
//Use 'CM' for centimeters or 'INC' for inches
{
Serial.println (distance);
if (distance > -1 && distance < 25)
{
else
}
stop();
delay(1000);
goBackward();
delay (300);
stop();
delay(1000);
if (random (0, 2) 0)
}
}
else {
goLeft();
goRight ();
delay(500);
stop();
delay (700);
goForward();
=
Transcribed Image Text:#include <HCSR04.h> UltraSonicDistance Sensor ultrasonic (A0, A1); float distance; // left motor int leftMotor SpeedPin = 3; int leftMotor ForwardPin = 4; int leftMotorBackwardPin = 5; // right motor int rightMotorSpeedPin = 11; int rightMotorForwardPin = 12; int rightMotorBackwardPin = 13; STEP2. void setup() { } pinMode (leftMotorSpeedPin, OUTPUT); pinMode (leftMotorForwardPin, OUTPUT); pinMode (leftMotorBackwardPin, OUTPUT); pinMode (rightMotor SpeedPin, OUTPUT); pinMode (rightMotor ForwardPin, OUTPUT); pinMode (rightMotorBackwardPin, OUTPUT); Serial.begin(9600); digitalWrite (leftMotorSpeedPin, HIGH); digitalWrite (rightMotorSpeedPin, HIGH); STEP4. void goForward() { digitalWrite (leftMotorForwardPin, HIGH); digitalWrite (leftMotorBackwardPin, LOW); digitalWrite (rightMotor ForwardPin, HIGH); digitalWrite (rightMotorBackwardPin, LOW); } void goBackward () { digitalWrite (leftMotor ForwardPin, LOW); digitalWrite (leftMotorBackwardPin, HIGH); digitalWrite (rightMotor ForwardPin, LOW); digitalWrite (rightMotorBackwardPin, HIGH); } void stop() { digitalWrite (leftMotor ForwardPin, LOW); digitalWrite (leftMotorBackwardPin, LOW); digitalWrite (rightMotor ForwardPin, LOW); digitalWrite (rightMotor BackwardPin, LOW); } void goRight() { digitalWrite (leftMotor ForwardPin, HIGH); digitalWrite (leftMotorBackwardPin, LOW); digitalWrite (rightMotor ForwardPin, LOW); digitalWrite (rightMotorBackwardPin, LOW); } void goLeft () { digitalWrite (leftMotorForwardPin, LOW); digitalWrite (leftMotorBackwardPin, LOW); digitalWrite (rightMotor ForwardPin, HIGH); digitalWrite (rightMotor BackwardPin, LOW); void loop() STEP3. distance ultrasonic.measureDistanceCm (); { { //Use 'CM' for centimeters or 'INC' for inches { Serial.println (distance); if (distance > -1 && distance < 25) { else } stop(); delay(1000); goBackward(); delay (300); stop(); delay(1000); if (random (0, 2) 0) } } else { goLeft(); goRight (); delay(500); stop(); delay (700); goForward(); =
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY