0

lately i installed servoblaster to my raspberry pi and then tried a simple python code `

import os
import time
os.system('sudo ./servod')
while True:
 os.system("echo 1=100 > /dev/servoblaster")
 time.sleep(0.5)
 os.system("echo 1=1 > /dev/servoblaster")
 time.sleep(2)

i put the code in the directory of servoblaster /home/pi/PiBits/ServoBlaster/user/file1.py but when run sudo python file1.py this what i got

pi@raspberrypi:~/PiBits/ServoBlaster/user $ sudo python file1.py
Board model: 2
GPIO configuration: P1 (40 pins)
Using hardware: PWM
Using DMA channel: 14
Idle timeout: Disabled
Number of servos: 8
Servo cycle time: 20000us
Pulse increment step size: 10us
Minimum width value: 50 (500us)
Maximum width value: 250 (2500us)
Output levels: Normal
Using P1 pins: 7,11,12,13,15,16,18,22
Servo mapping:
 0 on P1-7 GPIO-4
 1 on P1-11 GPIO-17
 2 on P1-12 GPIO-18
 3 on P1-13 GPIO-27
 4 on P1-15 GPIO-22
 5 on P1-16 GPIO-23
 6 on P1-18 GPIO-24
 7 on P1-22 GPIO-25
Invalid width specified
Invalid width specified
Invalid width specified
Invalid width specified
Invalid width specified
Invalid width specified
Invalid width specified

Can you please tell me what's wrong.

LotPings
3661 silver badge13 bronze badges
asked Sep 1, 2017 at 16:34

1 Answer 1

1

Invalid width specified

See https://github.com/richardghirst/PiBits/tree/master/ServoBlaster

Generally a servo will expect pulse widths in the range 1000 to 2000 microseconds although some will go between 500 to 2500.

os.system("echo 1=100 > /dev/servoblaster")

sets 1000μs which should be okay.

os.system("echo 1=1 > /dev/servoblaster")

sets 10μs which will be invalid.

answered Sep 1, 2017 at 17:40
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.