Skip to content

Instantly share code, notes, and snippets.

@elktros
Created September 27, 2016 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elktros/fe6d259667461de7709f9517b229a63a to your computer and use it in GitHub Desktop.
Save elktros/fe6d259667461de7709f9517b229a63a to your computer and use it in GitHub Desktop.
#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