Question
Write a flow chart for the following Arduino program int motorPin1 = 9;// variable to store pin number for motorpin 1 int motorPin2 = 7;//
Write a flow chart for the following Arduino program
int motorPin1 = 9;// variable to store pin number for motorpin 1 int motorPin2 = 7;// variable to store pin number for motorpin 1
void setup() { Serial.begin(9600); pinMode(motorPin1,OUTPUT);// set motor pin 1 as output pin pinMode(motorPin2,OUTPUT);// set motor pin 2 as output pin pinMode(10,OUTPUT); // set pin 10 as output pin which is connect to the EN pin in L293D
}
void loop() { digitalWrite(10,HIGH);// turn on the motor
//start rotetation of the motor : digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, LOW);
delay(10000);
// stop rotetion of the motor: digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, LOW);
delay(3000);
// start rotetion in oposite direction: digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, HIGH);
delay(10000);
// stop rotetion of the motor: digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, LOW);
delay(3000); }
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