Experiment No. 14: DC-Motor Control Connection:: Microprocessor
Experiment No. 14: DC-Motor Control Connection:: Microprocessor
Experiment No. 14: DC-Motor Control Connection:: Microprocessor
Coding:
int enmotor1=10;
int enmotor2=11;
int motor1=8;
int motor2=9;
int motor3=12;
int motor4=13;
void setup() {
pinMode(enmotor1, OUTPUT);
pinMode(enmotor2, OUTPUT);
pinMode(motor1, OUTPUT);
pinMode(motor2, OUTPUT);
pinMode(motor3, OUTPUT);
pinMode(motor4, OUTPUT);
}
void loop() {
analogWrite(enmotor1, 153);
analogWrite(enmotor2, 255);
MICROPROCESSOR
digitalWrite(motor1, HIGH);
digitalWrite(motor2, LOW);
digitalWrite(motor3, HIGH);
digitalWrite(motor4, LOW);
delay(9000);
digitalWrite(enmotor1, LOW);
digitalWrite(enmotor2, LOW);
delay(200);
analogWrite(enmotor1, 255);
analogWrite(enmotor2, 153);
digitalWrite(motor1, LOW);
digitalWrite(motor2, HIGH);
digitalWrite(motor3, LOW);
digitalWrite(motor4, HIGH);
delay(9000);
MICROPROCESSOR