Skip to content

Instantly share code, notes, and snippets.

@ntlk
Created May 31, 2012 13:58
Show Gist options
  • Save ntlk/2843580 to your computer and use it in GitHub Desktop.
Save ntlk/2843580 to your computer and use it in GitHub Desktop.
Arduino Theremin
/**
* 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