Interface Potentiometer and servo motor with Arduino Uno. Develop an Arduino sketch to control angle of servo motor using potentiometer.
Here i am using online IDE Tinkercad . If you don't know what is tinkercad then refer my blog HERE or else you can use offline IDE also.
Code :-
#include <Servo.h>
int val;
Servo servo_9;
void setup()
{
servo_9.attach(9);
}
void loop()
{
val =
analogRead(A0);
servo_9.write(val/4);
delay(15);
}
Output :-
Comments
Post a Comment