Michelangelo Guarise
Published

UDOO Theremin

Revive an iconic musical instrument with UDOO!

Full instructions provided1,264
UDOO Theremin

Things used in this project

Hardware components

UDOO DUAL
UDOO DUAL
×1

Story

Read more

Code

code.txt

C/C++
int IRpin = A0;
int distance = 0;
int msg = 0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly: 
  distance = analogRead(IRpin);
  
  if (distance < 100) {
    distance = 100;  
  } else if (distance > 900){
    distance = 900;
  }

  msg = map(distance, 100, 900, 0, 255);
  Serial.write(msg);
}

Credits

Michelangelo Guarise

Michelangelo Guarise

7 projects • 54 followers
Founder @ volumio.org , passionate maker, unpredictable developer, misunderstood creative. I do stuff, I build things.

Comments

Add projectSign up / Login