Skip to content

Instantly share code, notes, and snippets.

@neosarchizo
Last active November 8, 2015 13:21
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 neosarchizo/0184aa97b223ffb2a043 to your computer and use it in GitHub Desktop.
Save neosarchizo/0184aa97b223ffb2a043 to your computer and use it in GitHub Desktop.
[아두이노, 상상을 현실로 만드는 프로젝트 입문편] 코드 13 - 2
#include <Servo.h>
Servo myservo;
void setup()
{
myservo.attach(9);
}
void loop()
{
int val = analogRead(A0);
int rad = map(val, 0, 1023, 0, 120);
myservo.write(rad);
delay(15);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment