Created
September 27, 2016 15:17
-
-
Save elktros/fe6d259667461de7709f9517b229a63a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
Servo servoknob; | |
int potpin = 0; | |
int val; | |
void setup() | |
{ | |
servoknob.attach(11); | |
} | |
void loop() | |
{ | |
val = analogRead(potpin); | |
val = map(val, 0, 1023, 0, 180); | |
servoknob.write(val); | |
delay(15); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment