Hello, everyone.
The problem I have is as follows.
IDE: 1.8.2 V in windows
Arduino type: promini Atmega328 3.3V 8MHz
Element: 1 motor driver, 2 DC motors, 1 servo motor, 2 lithium polymer batteries.
Condition: servo lib. for servo motor, analogWrite func. for DC motor
Piece-wise code:
//analogWrite pin:3, 5, 6, 9, 10, 11
int servo_pin = 5;
int right_motor_pin = 10;
int left_motor_pin = 11;
void setup(){
//myservo.attach(servo_pin);
//pinMode(right_motor_pin, OUTPUT);
//pinMode(left_motor_pin, OUTPUT);
}
void loop(){
//myservo.write(value1);
//right_motor_go(value2);
//left_motor_go(value3);
}
Issue:
- Servo works well in alone code.
- Right DC motor works well in alone code.
- Left DC motor works well in alone code.
If driving three parts simultaneously, left motor doesn't work.
So, I change the pins to other PWM pins, one motor always doesn't work.
Opinion:
Each part works well in alone code, so hardware and software is OK, I think.
Is it impossible to use 1 servo and 2 dc motors in Arduino promini?
Or am i something missing?
Plz help me.....
Thank you for reading my topic.
P.S.
If I add a myservo.attach(servo_pin) func in void setup,
then, left motor doesn't works.
But without myservo.attach(servo_pin) func in void setup,
then, left motor works.
In the opposite case,
with or without myservo.attach(servo_pin) func in void setup,
right motor always works.
Does PWM pins have an internal connection?
