Home
About
Blog
Photo Gallery
Projects
Actuators
Resources
Suppliers
Techniques

Techniques - Selecting

Selecting can be done in two ways, analogue or digital. The technique shown below shows an analogue resistive ladder with tapping points. This is handy if you run out of digital pins.

Circuit Diagram Rotary Switch (resitive ladder) Arduino Code Snippet.
Resitive Ladder
Resitive Select
valInstSelect = analogRead(4);
valRange = valInstSelect;
// Resistor change range 0, 203, 408, 613, 819, 1023. see analog test routine.
if (valRange <=100) // Is it Piano
{ instrument_type1 = acoustic_grand_piano; }
else if(valRange <=250) // Is it a piccolo
{ instrument_type1 = piccolo; }
else if(valRange <=500) // Is it jazz guitar
{ instrument_type1 = electric_guitar_jazz; }
else if(valRange <=700) // Is it slow strings
{ instrument_type1 = slow_strings; }
else if(valRange <=900) // Is it a cello
{ instrument_type1 = cello; }
else if(valRange <1050) // Is it choir aahs
{ instrument_type1 = choir_aahs; }

 

Home
About
Blog
Photo Gallery
Projects
Actuators
Resources
Suppliers
Techniques