SERVO CONTROL USING JOYSTICK MODULE
VIDEO:
VIDEO LINK: https://youtu.be/Xxs-a0JTmcA
COMPONENTS REQUIRED:
1.JOYSTICK MODULE
2.ARDUINO NANO
3.SERVO MOTOR
4.BREAD BOARD
5.JUMER CABLES
CODE:
//CREATIVE PRADEEP//
#include <Servo.h>
const int Y_pin = A0; // analog pin connected to Y output
Servo myservo;
int val;
void setup() {
myservo.attach(7);
}
void loop() {
val = analogRead(Y_pin);
val = map(val, 0, 1023, 0, 180);
myservo.write(val);
delay(15);
}
CIRCUIT DIAGRAM:
CHANNEL LINK: www.youtube.com/c/CreativePradeep
Comments
Post a Comment