title: Creating a wave using MEGA2560 (analogWrite)
body: <p>Been trying to create a wave using the PWM ports (because this Arduino doesn't have DAC)of an Arduino Mega using this code. In the simulation I use a wave form generator that goes to A0, then I just want to convert it from 1023 bits to 255 but I get nothing as output.</p>
  
  <pre><code>int in = A0;
  int out = 10;
  
  void setup()
  {
    pinMode(in, INPUT);
    pinMode(out, OUTPUT);
  }
  
  void loop(){
    analogRead(in);
    analogWrite(10, in/4);
  }
  </code></pre>
  
  <p>Any suggestion would be great, thanks in advance!</p>