/*Cintrol the Spin*/
#include <Servo.h> //accesses the Arduino Servo Library
Servo myservo; // creates servo object to control a servo
int val; // variable to read the value from the analog pin
void setup()
{
myservo.attach(9); // ensures output to servo on pin 9
}
void loop()
{
val = analogRead(0); // reads the value of the potentiometer from A0 (value between 0 and 1023)
val = map(val, 0, 1023, 0, 180); // converts reading from potentiometer to an output value in degrees
//of rotation that the servo can understand
myservo.write(val); // sets the servo position according to the input from the potentiometer
delay(15); // waits 15ms for the servo to get to set position
}
uno:A5.2
uno:A4.2
uno:AREF
uno:GND.1
uno:13
uno:12
uno:11
uno:10
uno:9
uno:8
uno:7
uno:6
uno:5
uno:4
uno:3
uno:2
uno:1
uno:0
uno:IOREF
uno:RESET
uno:3.3V
uno:5V
uno:GND.2
uno:GND.3
uno:VIN
uno:A0
uno:A1
uno:A2
uno:A3
uno:A4
uno:A5
servo1:GND
servo1:V+
servo1:PWM
pot1:GND
pot1:SIG
pot1:VCC