Objective
Control the spin of the motor with the joy stick
Code
Arduino Instructions
- Connect a wire from the 5V to the power rail and another from GND to the ground.
Let’s first connect the joystick. Take three female-to-male wires:
- Connect the female (the open one) to the GND of the joystick and the male (with the metal pin sticking out) to ground rail on the breadboard.
- Connect the female (the open one) to the +5V of the joystick and the male (with the metal pin sticking out) to the power rail on the breadboard.
- Connect the female (the open one) to the of the joystick and the male (with the metal pin sticking out) to AO on the Arduino.
Let’s connect the Micro Servo.
- Place it flat on the floor. Flatten the wire and unwind the twists. The orange wire is input. The middle is power. The brown wire is ground.
- Connect a wire from the input to pin 8.
- Connect a wire from the power wire to the power rail on the breadboard.
- Connect a wire from the ground wire to the ground rail on the breadboard.
Now upload your code and move the joystick to turn the Micro Servo.