actually, if you look closer at my playComplete, I have removed the while(1){} in order for it to be able to check for other buttons.
so this could actually be the problem? that the arduino is doing other stuff while playing?? wow this is getting interesting
Wave Shield Distortion
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- soerena
- Posts: 57
- Joined: Fri Nov 16, 2012 7:00 am
Re: Wave Shield Distortion
i just tried putting back the while(1), and now there's no distortion!! wauw!
So I need to find some kind of work-around, for it to listen for other buttons without distorting while playing.. any ideas?
So I need to find some kind of work-around, for it to listen for other buttons without distorting while playing.. any ideas?
- adafruit_support_bill
- Posts: 88037
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield Distortion
The playback is interrupt-driven, so normal program execution should not affect it. However, it is possible that the i2c communication disables interrupts long enough to disrupt the timing.
- soerena
- Posts: 57
- Joined: Fri Nov 16, 2012 7:00 am
Re: Wave Shield Distortion
OK, so it seems to be the I2C read that I'm doing that causes the distortion. A few delays for debouncing doesn't affect the sound.
- adafruit_support_bill
- Posts: 88037
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield Distortion
Delays should be fine. The delay function does not disable interrupts.
- soerena
- Posts: 57
- Joined: Fri Nov 16, 2012 7:00 am
Re: Wave Shield Distortion
So reading an I2C device disables interrupts, but writing doesn't?
Because I'm writing without any audible issues, but as soon as I start reading there's distortion.
Because I'm writing without any audible issues, but as soon as I start reading there's distortion.
- adafruit_support_bill
- Posts: 88037
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield Distortion
Writing does not need to use interrupts. The writer is in control of the bus and does not need to respond to asynchronously received data.
- soerena
- Posts: 57
- Joined: Fri Nov 16, 2012 7:00 am
Re: Wave Shield Distortion
Thanks Bill! That cleared up some stuff.
So now that I can't use the I2C for reading, I guess I'll have to make a resistor ladder on my device nr 2 as well since I only have 11 available IO's on the board.
Are there any work-arounds, alternatives or is this really what I have to do? If so, then I'm in a hell of a hurry to rearrange my circuit and everything.
So now that I can't use the I2C for reading, I guess I'll have to make a resistor ladder on my device nr 2 as well since I only have 11 available IO's on the board.
Are there any work-arounds, alternatives or is this really what I have to do? If so, then I'm in a hell of a hurry to rearrange my circuit and everything.
- adafruit_support_bill
- Posts: 88037
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield Distortion
Options I can see are:
- A resistor ladder as you suggested.
Wire your buttons in a matrix like a keypad: http://playground.arduino.cc/Main/KeypadTutorial
Some combination of the above.
Please be positive and constructive with your questions and comments.