[아두이노, 상상을 현실로 만드는 프로젝트 입문편] 코드 9 - 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
void setup() { | |
} | |
void loop() { | |
int light = analogRead(A0); | |
int hertz = map(light, 0, 1023, 31, 4978); | |
tone(8, hertz, 100); | |
delay(100); | |
noTone(8); | |
delay(200); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment