Having Trouble Figuring out project's current consumption

Status
Not open for further replies.

cosmictea

Member
Hello,

I am working on a sequencer with layering. Here's the code:

in attachment (sorry it was too long)

The Hardware I am using is the Teensy 3.2, the PJRC audio board, a 10k linear potentiometer, and 9 momentary pushbuttons. The idea is that pressing any of the buttons 1-8 loads a sample into the sequence. Button 9 (digital pin 9) controls which layer of beats plays, 1, 2 or both simultaneously. I am sending 3.3V to the potentiometer via an Arduino Uno, but I am reading its output through the A2 pin of the Teensy.

I would like to calculate current consumption, since the code seems to work fine when only 8 buttons are pulled up, and all the samples play properly.
But when I pull up button 9, none of the samples play. The code continues to go through the sequence that I can see based on the Serial prints in my code. The code seems to function properly except that the samples don't play when button 9 is pulled up. I have come across this in several projects, using the same hardware setup.

Does this sound current related? It seems to have a problem opening the Sd card when the button 9 is pulled up. Interestingly, I can power the 10k pot using the Teensy 3.3V pin instead of the separate Uno, and not have any problems with the code. Which is why I am hesitant to assume it is the current. Also, I should not that I've tried this sketch at all clock speeds, from 96 to 24 mhz.

Thank you
 

Attachments

  • _8StepSamplerLayers.ino
    97.1 KB · Views: 117
wow Frank B thank you for the fast response. I see that I completely forgot to take other pins being used by the teensy into account. May I ask, is there a general rule about how much AudioMemory to allocate on the number of audio objects? Thanks!
 
Status
Not open for further replies.
Back
Top