2

So, I have this code (Arduino Mega):

void setup()
{
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(6, OUTPUT);

  analogWrite(10, 50);
  analogWrite(11, 50);
}

very basic motor speed control. Now when I do this (nothing else is connected to board, only 10 and 11 PWM control pins):

void setup()
{
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(6, OUTPUT);

  analogWrite(10, 50);
  analogWrite(11, 50);
  digitalWrite(6, 0);
}

motors stop. As if those analogWrites are ignored. Is this some exteption about Arduino board? Or is it just a bug? Again, nothing else is connected. Only 10 and 11 PWM outputs. Pin 6 is free. I tried puting digitalWrite above analogs - nothing.

4
  • what does this mean? ... I tried puting digitalWrite above analogs - nothing. Commented Oct 10, 2020 at 18:27
  • 1
    Is it a genuine Arduino or a cheap Chinese knock-off? Commented Oct 10, 2020 at 22:05
  • Chinese. But does it matter? Commented Oct 11, 2020 at 13:19
  • How are you measuring the PWM output? With an oscilloscope? Commented Oct 11, 2020 at 15:18

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.