Control Shield Exercises

The Control Shield is versatile enough to allow a variety of exercises.


I have tried to use a blind-accessible format for the exercise sketches:

  • Each file begins with a C++ comment block: // ...
  • Each file ends with a unique comment: //SYSIN ...
  • Most code resides in the first 40 columns.
  • Most comments reside in the first 50 columns.
  • No tabs are used; just spaces.

For convenience, here is a Zip archive of the exercises: Please let me know if I've missed anything that would help!


I've made a start on some simple and/or essential sketches, leaning heavily on Michael Margolis's (wonderful!) Arduino Cookbook:

Cycle Pitch

The Cycle Pitch sketch raises the pitch each time the top button is pressed.

Uses: delay(), digitalWrite(), pinMode(), tone()


The dooDooDOO sketch plays a three-tone alert in setup().

Uses: delay(), pinMode(), tone()

Pitch Pot

The Pitch Pot sketch varies delay and pitch using a potentiometer.

Uses: analogRead(), delay(), pinMode(), tone()

Pitch Rot

The Pitch Rot sketch varies delay and pitch using a rotary encoder.

Uses: attachInterrupt(), delay(), digitalRead(), digitalWrite(), interrupts(), noInterrupts(), pinMode(), Serial.println(), String(), tone()

Pitch Tilt

The Pitch Tilt sketch varies delay and pitch using a joystick.

Uses: analogRead(), delay(), pinMode(), tone()

Raw Tone

The Raw Tone sketch plays an intermittent tone in loop().

Uses: delay(), delayMicroseconds(), digitalWrite(), pinMode()

Setup Alert

The Setup Alert sketch plays a two-tone alert.

Uses: setup(), delay(), pinMode(), tone()


Here are some other ideas, variations, etc.

Analog Inputs

ADCs 0 & 1 can detect analog voltage levels produced by the joystick. Vertical and horizontal tilt affect ADC0 and ADC1, respectively.

  • Measure the joystick voltages.

ADCs 2 & 3 can detect voltages produced by potentiometers 0 & 1. Digital pins 6 & 7, when used as AIN0 and AIN1, can be used to compare these voltages.

  • Measure and compare the potentiometer voltages.

ADCs 4 & 5 can detect voltages from the 1/8" stereo input jack. If both this jack and the output jack are unoccupied, they can detect (PWM) analog levels generated by digital pins 9 & 10. (Potentiometers 2 & 3 determine the time constants.)

  • Measure the input voltages.

  • Measure the PWM voltages and settling time.

Digital Output

Pins 9 & 10 can be cycled to produce (say) square waves in the left and right channels of the Out Jack.

  • Generate the same tone in both channels.

  • Vary the amplitude and pitch, using the joystick.

  • Vary the pitch, using the rotary encoder.

  • Toggle the encoder between amplitude and pitch,
    using its push switch.

  • Generate a pair of tones, in stereophonic mode.

  • Use the buttons to change the generated tones.

This wiki page is maintained by Rich Morin, an independent consultant specializing in software design, development, and documentation. Please feel free to email comments, inquiries, suggestions, etc!

Topic attachments
I Attachment Action Size Date Who Comment
CSE-0.1.1.zipzip manage 186 K 27 Feb 2016 - 03:55 Main.RichMorin  
Topic revision: r21 - 05 Mar 2016, RichMorin
This site is powered by Foswiki Copyright © by the contributing authors. All material on this wiki is the property of the contributing authors.
Foswiki version v2.1.6, Release Foswiki-2.1.6, Plugin API version 2.4
Ideas, requests, problems regarding CFCL Wiki? Send us email