Trouble with PWM pins

Hello everyone and thank you in advance for any help you may give.

Bellow is mycode. The problem is that myservo.attach(10) causes one of my two motors to not turn. As long as I don’t include that in my code I have no problems with either motor. Also I can’t get the PWM function on pins 3, 5, and 6 to work; not for motors or servos. What am I doing wrong?

#include <Servo.h> 

int LMotorD_PIN = 8;  
int RMotorD_PIN = 12; 
int RmotorPWM_PIN = 9; 
int LmotorPWM_PIN = 11;

Servo myservo;
void setup() 
  pinMode(LMotorD_PIN, OUTPUT);
  pinMode(RMotorD_PIN, OUTPUT);
void loop() 

   digitalWrite(RMotorD_PIN, HIGH);
   digitalWrite(LMotorD_PIN, HIGH);
   analogWrite(LmotorPWM_PIN, 100);
   analogWrite(RmotorPWM_PIN, 100);


Read this :slight_smile:

Also see this post:

Thank you very much you two. I totaly missed the part where servos can only be attached to pins 9 & 10.