Modifying the pitch

Taking a look at how map() works in the Theremin quest circuit, you can start to understand how map works:

map(value, fromLow, fromHigh, toLow, toHigh); to map(photoVal, 190, 1100, 150, 1500);

The first two values correspond to the photo light sensor, while the last two are the pitch. Try modifying the last two values (150 and 1500) up and down. You'll get different sounds every time!

Stop the Music!

You may have gotten annoyed with the spooky sounds coming out of your theremin. There are two ways to stop this sound.

One way to do this is with a push-button. Plug one into your breadboard and wire it up to Digital Pin 2:

Next, modify the Arduino code to call NoTone() when the button is pressed. We'll leave this up to you to figure out. One hint is to look at both the NoTone() documentation and CIRC07's code.

This guide was first published on Aug 18, 2017. It was last updated on Jun 12, 2017.

This page (Make It Better) was last updated on Jul 05, 2017.

Text editor powered by tinymce.