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

Popular Posts

What is Tinkercad ? How to use Tinkercad ?

Connect switch to Arduino. If switch is on than print ”ON” else print “OFF” on serial monitor.

Develop an interfacing circuit and a sketch to increment count on 7-Segment based on switch press. Count goes from 00 to 99.