Adafruit Voice changer (minimal sketch)?
Moderators: adafruit_support_bill, adafruit

Re: Adafruit Voice changer (minimal sketch)?

by xl97 on Thu Mar 14, 2013 9:03 pm

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)
xl97
 
Posts: 144
Joined: Mon Jul 27, 2009 12:51 pm

Re: Adafruit Voice changer (minimal sketch)?

by pburgess on Thu Mar 14, 2013 9:19 pm

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.
User avatar
pburgess
 
Posts: 2668
Joined: Sun Oct 26, 2008 2:29 am

Re: Adafruit Voice changer (minimal sketch)?

by keeleon on Thu Mar 14, 2013 11:34 pm

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.


Ok, so I uploaded this

Code: Select all | TOGGLE FULL SIZE
void setup() {
  Serial.begin(9600);
  pinMode(A0, INPUT);
}

void loop() {

  int State = analogRead(A0);
  Serial.println(State);
  delay(1);
}


into the arduino, and connected the mic to 5v, GND and A0. All it does is cycle through around 540. I can yell into it, or snap at it or bang next to it with no change. I also tried it on A1 with the same result :(
keeleon
 
Posts: 29
Joined: Sun Jul 17, 2011 6:39 pm

Re: Adafruit Voice changer (minimal sketch)?

by keeleon on Thu Mar 14, 2013 11:37 pm

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.
keeleon
 
Posts: 29
Joined: Sun Jul 17, 2011 6:39 pm

Re: Adafruit Voice changer (minimal sketch)?

by pburgess on Fri Mar 15, 2013 12:38 pm

Well bummer, that does sound like a DOA board.

Please email support@adafruit.com and include your order number and a link to this post, and we'll get a replacement out to you.
User avatar
pburgess
 
Posts: 2668
Joined: Sun Oct 26, 2008 2:29 am

Re: Adafruit Voice changer (minimal sketch)?

by janz on Tue Apr 30, 2013 7:08 pm

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.

Code: Select all | TOGGLE FULL SIZE

//////////////////////////////////// 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: 30
Joined: Tue Mar 12, 2013 6:52 pm

Re: Adafruit Voice changer (minimal sketch)?

by janz on Tue Apr 30, 2013 7:50 pm

OK, something does happen...the pitch of my static changes..
janz
 
Posts: 30
Joined: Tue Mar 12, 2013 6:52 pm

Re: Adafruit Voice changer (minimal sketch)?

by janz on Tue Apr 30, 2013 8:27 pm

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.
janz
 
Posts: 30
Joined: Tue Mar 12, 2013 6:52 pm