The sketch
const int motor = 4; const int btn1 = 5; const int btn2 = 6; const int btn3 = 7; int button1 = 0; int button2 = 0; int button3 = 0; int var1 = 0; int var2 = 0; int var3 = 0; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(btn1,INPUT); pinMode(btn2,INPUT); pinMode(btn3,INPUT); pinMode(motor,OUTPUT); } void loop() { //Unlimited Execution // Eco-Programmer AST(); } void AST(){ //This is the customized void button1 = digitalRead(btn1); button2 = digitalRead(btn2); button3 = digitalRead(btn3); if(button1 == HIGH){ var1=1; var2=0; var3=0; Serial.write(var1); } if(button2 == HIGH){ var1=0; var2=1; var3=0; Serial.write(var2); } if(button3 == HIGH){ var1=0; var2=0; var3=1; Serial.write(var3); } if(var1 == 1){ digitalWrite(motor, HIGH); delay(15); digitalWrite(motor, LOW); delay(40); } if(var2 == 1){ digitalWrite(motor, HIGH); delay(15); digitalWrite(motor, LOW); delay(20); } if(var3 == 1){ digitalWrite(motor, HIGH); delay(50); digitalWrite(motor, LOW); delay(10); } else{ digitalWrite (motor, LOW); } } |
push button dc motor control arduino.
arduino dc motor with push button.
arduino push button dc motor.
arduino dc motor control with button.
motor button.
button motor.
arduino digitalread speed.
speed control button.
motor push button.
control speed of dc motor arduino.
dc motor with button arduino.
arduino joystick dc motor control.
arduino joystick motor control.
dc motor speed control with joystick.
arduino joystick dc motor control code.
arduino dc motor speed control.
push button motor.
small dc motor arduino.
arduino dc motor control code.
arduino joystick motor control code.
arduino control motor speed.
dc motor joystick arduino.
arduino dc motor potentiometer.
arduino digitalwrite speed.
speed control of dc motor using arduino.
dc motor speed control arduino.
how to control speed of dc motor using arduino.
arduino uno motor control.
motor speed control using arduino.
dc motor control using arduino.
arduino motor speed.
arduino dc motor control.
dc motor control arduino.
control dc motor with potentiometer arduino.
arduino joystick button code.
dc motor control using arduino uno.
arduino joystick push button.
dc motor speed control arduino code.
Can I use this concept to power up a 150v DC motor?
ReplyDeletecan use arduino uno ?
ReplyDeleteIf I have a larger DC motor, I can control a DC motor controller with this program instead of use a potentiometer?
ReplyDeleteThis coding I use in joystick L298 controller in wheelchair
ReplyDeletecan i use 12 vdc?
ReplyDeleteYou can use this https://www.youtube.com/watch?v=Qvz93-_MPfM relay for that.
Deletecan u show connection of arduino uno?
ReplyDeleteYou can use the code above it's the same thing with different pins setting maybe plus I don't have Arduino UNO and I don't really want to waste much time in it, reason can be found in the all Arduino posts.
Deletewow great code.
ReplyDelete