2019-05-06 (M) Little Drummer Bot LittleDB

I uploaded a simple testing program that continuously reports back on the level of the digital inputs. It found two things. The first thing was that the capacitive board gave sourcing outputs (high when selected) and the rotary switch was wired for sinking (low when selected). This would be easy to accommodate during programming but would require different approaches. The second problem was that one output from the button board was not working and none of the switch connections were working.
Confusing switch ring

The issue with the switch was tracked down to its configuration. In the top was a pegged washer that I assumed was a poorly placed anti-rotation washer. In truth, it was designed to limit the travel of the switch shaft, and during the soldering, the washer was out, and I rotated it beyond the limit, so it spun beyond the limit. It was replaced. When I first tested the switch, it had four positions, and each made a connection from a common terminal to one of four pegs, but now it had a fifth position which made no connections. The program will have no trouble recognizing this fifth position. If I don't need a fifth position, the washer can always move back to four, or even reduced to three.

Helpful switch ring

The problem with the missing connection on the button board was a cold solder joint. Fresh solder and a hot iron repaired the spot, and the test program reported good readings with the switch and capacitive sensors.
Working input

The final connection for testing was the MIDI output. An old version of the EWC program was modified so it would output a single note, middle C, twice per second. Since this program relied on the native serial port for MIDI communication, a serial monitor on the computer could not work simultaneously. A sound module detected and played the signal immediately.
Working MIDI output

Programming for the Little Drummer Bot was going to be a lot different than the Electronic Wind Chimes, but a few of the functions could be reused. A new program would be written, so pseudocode was sketched on a piece of paper. The concept was that there would be five modes, zero through four.
  1. The first mode would be a free play where each button played a note. Nothing fancy but a good place to start.
  2. Mode one would treat all the buttons as a single input and read the time between presses to average out a tempo from the user. This tempo value would be stored and usable by other functions.
  3. Mode two would allow for the construction of a simple loop that used any of the instruments from mode zero. Sounds would be played in the order the user touched them and evenly distributed timewise.
  4. Mode three would allow some of the settings, like tempo, soft reset, and a manual trigger for the loop
  5. The last mode was a metronome. Tempo from the previous settings would be used or tweaked but any single percussion instrument could be selected.

Pseudo code for LittleDB


First time here?

Completed projects from year 1
Completed projects from year 2
Completed projects from year 3
Completed projects from year 4
Completed projects from year 5
Completed projects from year 6

Disclaimer for http://24hourengineer.blogspot.com and 24HourEngineer.com




