hi-
'some' of the code has been tailored for my 'custom' variant of the Waveshield.. I'd use the code pburgess posted originally..
then look for the portion(s) that only change the internal reference to +5v..
(I also didnt use a pot.. but hard coded a value for testing)
Adafruit Voice changer (minimal sketch)?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Adafruit Voice changer (minimal sketch)?
Connect the mic output to one of the Arduino's analog pins, and write a small program that just sits in a loop reading the pin and printing the value to the serial port. In silence, the numbers should hover around 512. Shout at it and you should get the full range 0-1023. Might also need to fiddle with the gain pot on the board.
-
- Posts: 32
- Joined: Sun Jul 17, 2011 6:39 pm
Re: Adafruit Voice changer (minimal sketch)?
Ok, so I uploaded thisConnect the mic output to one of the Arduino's analog pins, and write a small program that just sits in a loop reading the pin and printing the value to the serial port. In silence, the numbers should hover around 512. Shout at it and you should get the full range 0-1023. Might also need to fiddle with the gain pot on the board.
Code: Select all
void setup() {
Serial.begin(9600);
pinMode(A0, INPUT);
}
void loop() {
int State = analogRead(A0);
Serial.println(State);
delay(1);
}
-
- Posts: 32
- Joined: Sun Jul 17, 2011 6:39 pm
Re: Adafruit Voice changer (minimal sketch)?
I am not using a pot for the mic, as I plan on just hardcoding it. Do you mean adjust the "volume" knob? That doesn't do anything either. I hope this mic didn't show up dead Is there something I could have done to break it? I barely touched it other than to solder the 3 wires.
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Adafruit Voice changer (minimal sketch)?
Well bummer, that does sound like a DOA board.
Please email [email protected] and include your order number and a link to this post, and we'll get a replacement out to you.
Please email [email protected] and include your order number and a link to this post, and we'll get a replacement out to you.
- janz
- Posts: 41
- Joined: Tue Mar 12, 2013 6:52 pm
Re: Adafruit Voice changer (minimal sketch)?
Hello,
I've got a working wave shield and microphone wired as in the tutorial. The startup chime plays. Using the short code above I've tested the microphone. The analogRead(A0) sits around 330 with a range of 0 - 700 with loud sounds.
How do I hard code the pitch? I've tried putting different large and small integers instead of analogRead(1) but nothing happens.
I've got a working wave shield and microphone wired as in the tutorial. The startup chime plays. Using the short code above I've tested the microphone. The analogRead(A0) sits around 330 with a range of 0 - 700 with loud sounds.
How do I hard code the pitch? I've tried putting different large and small integers instead of analogRead(1) but nothing happens.
Code: Select all
//////////////////////////////////// PITCH-SHIFT CODE
void startPitchShift() {
// Read analog pitch setting before starting audio sampling:
int pitch = analogRead(1);
Serial.print("Pitch: ");
Serial.println(pitch);
- janz
- Posts: 41
- Joined: Tue Mar 12, 2013 6:52 pm
Re: Adafruit Voice changer (minimal sketch)?
OK, something does happen...the pitch of my static changes..
- janz
- Posts: 41
- Joined: Tue Mar 12, 2013 6:52 pm
Re: Adafruit Voice changer (minimal sketch)?
Got it working. Because I wasn't using a pot, I didn't think that I needed the 3V to AREF. Then when i was looking through the code I noticed analogReference(external). I don't quite understand why, but with the extra wire least now it works.
- Runedellion
- Posts: 5
- Joined: Sat Nov 02, 2013 1:19 am
Re: Adafruit Voice changer (minimal sketch)?
I was going to make a third eye variation of the Demon and have mine wired like the Voice changer and Wave shield tutorial says. However, I am using the blue breadboard pot instead of the metallic looking 10k. Would that cause an issue with getting the voice changer to work? I've gotten the PiSpeak to work and have also had the shield play a song I put on the SD card and it sounds pretty nice. However when I try the adavoice sketch that does not use the SD card I get this odd kind of static. And since seeing this thread I tried that sketch that reads the mic output? and It hovers anywhere between 970 and 1023 on the Serial monitor. Any idea on what may be causing this issue? I have one new mic I was trying and an old one from a VU meter hat that worked to play with and they both haven't panned out. If it comes into question I am using Codebender, I have the Class D amplifier powered by the 3 AAAs pack and its running two of the speakers. The Uno is plugged into my computer and when I was going to make it portable I was going to power it with a powerbank. None of the LED backpacks are connected
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Adafruit Voice changer (minimal sketch)?
Breadboard pot is fine.
Do you have 3.3V connected to AREF on the Arduino?
Do you have 3.3V connected to AREF on the Arduino?
- Runedellion
- Posts: 5
- Joined: Sat Nov 02, 2013 1:19 am
Re: Adafruit Voice changer (minimal sketch)?
Does it also need to be joined with the vcc on the mic and the right leg of the pot? Thats how I had it but I may have had a bad grouping. Would it work the same to have the Aref connected directly to the 3.3v and the other connections on the second pinout of the 3.3v?
- Runedellion
- Posts: 5
- Joined: Sat Nov 02, 2013 1:19 am
Re: Adafruit Voice changer (minimal sketch)?
Update: Now that I tried to redo the group its just reads 1023 and something in the 900s when I tap on the mic using that code above. I just seen that if I wiggle the Class D amplifier that the digits will vary by about ten. Hmm Oh and thank you for the quick reply. I was up all night trying to figure out what may be wrong.
- Runedellion
- Posts: 5
- Joined: Sat Nov 02, 2013 1:19 am
Re: Adafruit Voice changer (minimal sketch)?
Yeah so the only thing that kept mine from working was a single ground wire I overlooked to the board from the 3 AAA and mic.
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Adafruit Voice changer (minimal sketch)?
Whew...so you're all good then?
- Runedellion
- Posts: 5
- Joined: Sat Nov 02, 2013 1:19 am
Re: Adafruit Voice changer (minimal sketch)?
Yes! A seatbelt broke something with my microphone but it was alot of fun to be a lost alien
- Attachments
-
- IMG_20141101_023225.jpg (814.95 KiB) Viewed 526 times
Please be positive and constructive with your questions and comments.