Created
May 31, 2012 13:58
-
-
Save ntlk/2843580 to your computer and use it in GitHub Desktop.
Arduino Theremin
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
/** | |
* A simple theremin | |
* Developed by the random bit | |
* http://therandombit.wordpress.com/2011/11/21/light-controlled-ldr-theremin/ | |
* | |
*/ | |
int val = 0; | |
void setup() { | |
pinMode(6, OUTPUT); | |
delay(3000); | |
} | |
void loop() { | |
digitalWrite(6, HIGH); | |
delayMicroseconds(val); | |
val = 4*analogRead(A5); | |
digitalWrite(6, LOW); | |
delayMicroseconds(val); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment