Wireless sound

Grumpy_Mike:
That makes no sense at all, you have used the wrong word, "temporary" means not permanent or efermal.

Ok ok, i just connected my amp and a speaker, it kills my hears! :roll_eyes:
But it's there

Grumpy_Mike:
Have you done this?
I assume it is in the setup function. You should use a frequency of over 30KHz.

How do i do that?

Thanks for your time and support

For changing the PWM frequency see this
http://playground.arduino.cc/Code/PwmFrequency

Grumpy_Mike:
For changing the PWM frequency see this
Arduino Playground - HomePage

I've tried every value possible and no solution, are you sure this will work? :frowning:

void setPwmFrequency(int pin, int divisor) {
  byte mode;
  if(pin == 5 || pin == 6 || pin == 9 || pin == 10) {
    switch(divisor) {
    case 1: 
      mode = 0x01; 
      break;
    case 8: 
      mode = 0x02; 
      break;
    case 64: 
      mode = 0x03; 
      break;
    case 256: 
      mode = 0x04; 
      break;
    case 1024: 
      mode = 0x05; 
      break;
    default: 
      return;
    }
    if(pin == 5 || pin == 6) {
      TCCR0B = TCCR0B & 0b11111000 | mode;
    } 
    else {
      TCCR1B = TCCR1B & 0b11111000 | mode;
    }
  } 
  else if(pin == 3 || pin == 11) {
    switch(divisor) {
    case 1: 
      mode = 0x01; 
      break;
    case 8: 
      mode = 0x02; 
      break;
    case 32: 
      mode = 0x03; 
      break;
    case 64: 
      mode = 0x04; 
      break;
    case 128: 
      mode = 0x05; 
      break;
    case 256: 
      mode = 0x06; 
      break;
    case 1024: 
      mode = 0x7; 
      break;
    default: 
      return;
    }

    TCCR2B = TCCR2B & 0b11111000 | mode;
  }
}

void setup() {
  pinMode(11, OUTPUT);
  setPwmFrequency(11, 1);
}

void loop(){
  int val = analogRead(A0);
  analogWrite(11, val);
}

Come on you know the score by now, code tags please.
Thanks for changing the post.

Grumpy_Mike:
Come on you know the score by now, code tags please.

hum? What do you mean?

Now when you say it doesn't work what do you mean:-

  1. There is no longer any sound out of it.
    or
  2. I can not perceive any improvement in the sound?