Wave Shield with Rotary Encoder
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adamr1
- Posts: 120
- Joined: Sun Jun 02, 2013 8:24 am
Wave Shield with Rotary Encoder
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
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Wave Shield with Rotary Encoder
I think the WaveHC library does use interrupts, but you can poll the encoder during the
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.
Code: Select all
while ( wave.isplaying() ) {
}
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.
- adamr1
- Posts: 120
- Joined: Sun Jun 02, 2013 8:24 am
Re: Wave Shield with Rotary Encoder
ok thanks, I will try that.
Please be positive and constructive with your questions and comments.