-
-
Save neosarchizo/0184aa97b223ffb2a043 to your computer and use it in GitHub Desktop.
[아두이노, 상상을 현실로 만드는 프로젝트 입문편] 코드 13 - 2
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 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