How to vibrate DC Motor Using Arduino Uno with program and diagram
Step 1. See the diagram and connect the wires on arduino uno.
Step 2. open arduino software on your pc download here
Step 3. Copy the program and paste in arduino software.
int motorPlus = 5;
int motorMinus = 6;
void setup() {
// put your setup code here, to run once:
pinMode(motorPlus,OUTPUT);
pinMode(motorMinus,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(motorPlus,HIGH);
digitalWrite(motorMinus,LOW);
delay(100);
digitalWrite(motorPlus,LOW);
digitalWrite(motorMinus,HIGH);
delay(100);
}
Step 4. connect arduino uno with your pc and upload the program
No comments:
Post a Comment