Devices & Components
Arduino Uno Rev3
SG90 Micro-servo motor
Analog joystick (Generic)
Jumper wires (generic)
Software & Tools
Arduino IDE
Project description
Code
Copy and paste the code at arduino IDE
java
1#include <Servo.h> 2const int Y_pin = A0; // analog pin connected to Y output 3 4Servo myservo; 5 6int val; 7 8void setup() { 9 myservo.attach(9); 10} 11 12void loop() { 13 val = analogRead(Y_pin); 14 val = map(val, 0, 1023, 0, 180); 15 myservo.write(val); 16 delay(15); 17}
Downloadable files
See the schematics and just copy it
See the schematics and just copy it

See the schematics and just copy it
See the schematics and just copy it

Comments
Only logged in users can leave comments