Wave Shield with Rotary Encoder
Moderators: adafruit_support_bill, adafruit

Wave Shield with Rotary Encoder

by adamr1 on Mon Feb 17, 2014 8:02 pm

Can you use a wave shield and a rotary encoder with interrupts. I want to use the rotary encoder to pick a song to play by the wave shield. Documentation that I found about rotary encoders says to use pin 2 and 3 on an uno but the wave shield has those hard wired. In a perfect world, if a song were playing on the wave shield, and you turned the encoder, it would stop the current song and play the next one. From what I understand, the wave shield uses interrupts to "play in the background?" So there will be a conflict, right? And I wont be able to use a rotary encoder? Thanks
adamr1
 
Posts: 66
Joined: Sun Jun 02, 2013 8:24 am

Re: Wave Shield with Rotary Encoder

by adafruit_support_mike on Mon Feb 17, 2014 11:55 pm

I think the WaveHC library does use interrupts, but you can poll the encoder during the

Code: Select all | TOGGLE FULL SIZE
while ( wave.isplaying() ) {
}

loop.

A couple of digital reads won't take long. You'll get the same overall effect, even though the code doesn't respond quite as immediately as it would with an interrupt.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 11337
Joined: Thu Feb 11, 2010 2:51 pm

Re: Wave Shield with Rotary Encoder

by adamr1 on Tue Feb 18, 2014 8:38 am

ok thanks, I will try that.
adamr1
 
Posts: 66
Joined: Sun Jun 02, 2013 8:24 am