Can't figure out what's wrong with my wave shield code

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
rossjon
 
Posts: 10
Joined: Thu Oct 16, 2014 4:06 pm

Re: Can't figure out what's wrong with my wave shield code

Post by rossjon »

I just tried an experiment and tied the music triggering to Chan1 like this:

Code: Select all

  attachInterrupt(Chan1Interrupt, Chan1_begin, RISING);
  //attachInterrupt(Chan2Interrupt, Chan2_begin, RISING);

Code: Select all

  if(Chan1_val > 1650 && Chan1_val <= 1910) {
    playfile("BRASS.WAV");
  }
This is exactly the same code that had the audio working as intended, except switched to the other interrupt. This does not work. I think that narrows it down to the Chan1 interrupt that's the problem. (int.1 = pin 3 on my Uno)

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Can't figure out what's wrong with my wave shield code

Post by adafruit_support_rick »

OK, sorry, I got it. I was getting confused between the wave interrupt and the audio control interrupt.

I not seeing where the problem could be. It's some problem between Chan1 and Chan2. I think you can demonstrate that by enabling both interrupts, and commenting out the call to wave.play(). I predict that you will still lose control of the drive after activating the audio. In other words, it's nothing to do with the actual waveshield operation.
I just tried an experiment and tied the music triggering to Chan1 like this:
EDIT : ok - interesting experiment. Still not seeing the problem...

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”