Controlling_180°Motor

This project lets you control a 180° servo motor with a joystick and a potentiometer, is it useful by itself? No, but that's not my problem.

Aug 5, 2021

1310 views

0 respects

Components and supplies

1

Rotary potentiometer (generic)

1

Jumper wires (generic)

1

Breadboard (generic)

1

Arduino Nano R3

1

Modulo Joystick

1

SG90 Micro-servo motor

Project description

Code

DaCode

c_cpp

The map function converts 0-1023 to 0-180 because the joystick/potentiometer can input a value from 0 to 1023 while the motor can move from 0 to 180 degrees.

Downloadable files

I just realized my circuit images are horrible.

In this circuit I show you the potentiometer version, you can replace it with the joystick just by connecting the red wire to 5v, the blue one to GND and the green one to the x or y axys pin; you could also use both the joystick and the potentiometer at the same time by connecting them both to A0.

I just realized my circuit images are horrible.

I just realized my circuit images are horrible.

In this circuit I show you the potentiometer version, you can replace it with the joystick just by connecting the red wire to 5v, the blue one to GND and the green one to the x or y axys pin; you could also use both the joystick and the potentiometer at the same time by connecting them both to A0.

I just realized my circuit images are horrible.

Comments

Only logged in users can leave comments