Mignon Photoresistor Theremin

Plug the Photoresistor in the extensions port to GND and to PIN19.

This code plays a permanent tone, which get as higher as less light is hitting the photoresistor.

#include <gamekit_2_1.h>

int light; // variable for the senor value

void setup(){
gamekit.Begin();

// enable pull up resistor for analog in
digitalWrite(19, HIGH);
}

void loop(){
light = analogRead(5);
gamekit.play_tone(light, 100,LOUD);
}

© olaf val, 2024