shapingthings

Arduino Theramin

Jan 20th, 2017
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. int speakerPin = 6;
  2. int photocellPin = 0;
  3.  
  4. void setup()
  5. {
  6. }
  7.  
  8. void loop()
  9. {
  10. int reading = analogRead(photocellPin);
  11. int pitch = 200 + reading / 4;
  12. tone(speakerPin, pitch);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment