A problem with a servo motor
Posted: Mon Mar 09, 2015 4:16 pm
Hello All,
I have a very strange situation. My detector consist of several components: a light sensor, a servo motor and and an led (PWM). Here is wiring:
light sensor - X1, VIN, GND
servo motor - X2, VIN, GND
led(pwm) - X3, GND
When I test the servo motor via picocom, everything works great but when I wire all components and run python3 pyboard.py detector.py - servo doesn't work (other parts work well). If I run python3 pyboard.py servo_test.py :
the servo works without any problems. So, my questions is : is there any compatibility problems between the pins? Maybe some of them cannot work together? Or I do something wrong? Please let me know if you need to see the code in detector.py
Thank you.
I have a very strange situation. My detector consist of several components: a light sensor, a servo motor and and an led (PWM). Here is wiring:
light sensor - X1, VIN, GND
servo motor - X2, VIN, GND
led(pwm) - X3, GND
When I test the servo motor via picocom, everything works great but when I wire all components and run python3 pyboard.py detector.py - servo doesn't work (other parts work well). If I run python3 pyboard.py servo_test.py :
Code: Select all
# servo_test.py
import pyb
import time
servo = pyb.Servo(2)
for i in range(3):
servo.angle(45)
time.sleep(1)
servo.angle(-45)
time.sleep(1)
Thank you.