Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

demo-pwm gives error

2700 Views - Created 01/12/2015

01/12/2015

Posted by:
cravengarden

cravengarden Avatar

Hi,
I'm a complete newbie and I've been trying to get the ServoPi working, but haven't connected and servos yet. Just trying to run demo-pwm.py.
When I run it I get the error
Traceback (most recent call last): File "demo-pwm.py", line 28, in <module> pwm.set_pwm_freq(1000) File "/home/pi/robot/ABE_ServoPi.py", line 63, in set_pwm_freq newmode = (oldmode & 0x7F) | 0x10TypeError: unsupported operand type(s) for &: 'exceptions.IOError' and 'int'
the line is newmode = (oldmode & 0x7F) | 0x10
contents of self.address is 64, self.MODE1 is 0 and the contents of oldmode shows as [Errno 5] Input/output error
I've setup i2c and smbus as per the instructions, but I must be doing something else wrong. Hopefully someone can help me find out what.
Thanks in anticipation!

01/12/2015

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

Is Solution

Hi

Are you powering the Servo Pi from the Raspberry Pi and if so have you joined the PWR Link pads with a solder bridge? We ship the Servo Pi with the PWR Link unbridged as we would normally recommend that you use an external 5V supply if you are using more than two or three servos. Without an external supply or the PWR Link pads bridged the python demos will return an IO error as the Raspberry Pi will not be able to communicate with the servo pi.

If the Servo Pi is powered then try running i2cdetect -y 1 in a command prompt and see if the servo pi is appearing on address 40. If it does not appear and the Servo Pi is powered then it could be a problem with the I2C installation in which case I would recommend going through the I2C tutorial again and checking that everything is correct.

Sign in to post your reply

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.