Go Down

Topic: DC motor interrupts servo (Read 911 times) previous topic - next topic


Hi all

I'm really a newbie in the arduino world and i wanted to build a little car whose wheels will be controlled by a dc-motor and there angle will be controlled by a servo. So basicly there's a Dc motor on top of a servo.
I wrote some code which actually should turn the servo 90 decrees then activate the motor, turn the servo from 90 decrees back to 0 and turn the motor again on.The Problem is when the motor start, the servo turns to 0 and when it actually should turn from 90 to 0 it goes first from 0 to 90 then to 0.


Code: [Select]
  for(pos = 0; pos < 90; pos += 1) 
} //servo turns to 0

If the goal is to get the servo to position 89, why not just tell it to get to 89? There is no purpose served by making it go there slowly, is there?

Most likely, you don't have a coding problem, you have a wiring problem. What is connected to what? What is powering the motor? The servo?
The art of getting good answers lies in asking good questions.


The two links in my signature might help you with this

Duane B
Read this
then watch this


Go Up