How to make 3 speed motor control using arduino?

1 Response

  1. admin says:

    Refer : Servo control by push button switch arduino

    /* Set a speed value between 0 to 255 for each variable
    speed_value1,speed_value2,speed_value3*/
    if (digitalRead(2) == HIGH) {
      // Pin - o/p to the motor from any of the PWM pin.
      analogWrite(Pin, speed_value1);
    }
    if (digitalRead(3) == HIGH) {
      analogWrite(Pin, speed_value2);
    }
    if (digitalRead(4) == HIGH) {
      analogWrite(Pin, speed_value3);
    }
    

Leave a Reply

Your email address will not be published. Required fields are marked *