Use 16-Channel 12-bit PWM/Servo Driver

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
tistar73
 
Posts: 4
Joined: Fri Jun 06, 2014 11:35 am

Use 16-Channel 12-bit PWM/Servo Driver

Post by tistar73 »

I need to set the pwm value of one of 16 channels.

I put a led on my 0 port (PWM and GND) and I use i2cset command to set value of 4096 but nothing change.

The command is:

i2cset -y 1 0x40 0x00 4096

I try to modify the example:

Code: Select all

#!/usr/bin/python
from Adafruit_PWM_Servo_Driver import PWM
import time
pwm = PWM(0x40, debug=True)
pwm.setPWM(0, 4096, 4096)
But nothing...

Where the error???

It's impossible to control LEDS with this board?

Thanks

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Use 16-Channel 12-bit PWM/Servo Driver

Post by adafruit_support_rick »

That should work. How do you have the LED wired? The long leg (anode) should got to PWM and the cathode should go to GND.

tistar73
 
Posts: 4
Joined: Fri Jun 06, 2014 11:35 am

Re: Use 16-Channel 12-bit PWM/Servo Driver

Post by tistar73 »

I have (just form security) connect the anode to v+ and the LED work perfect!!

If I use servo_example.py the power led on servo board go off...

...and nothing happens.

Maybe the board is broken?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Use 16-Channel 12-bit PWM/Servo Driver

Post by adafruit_support_rick »

Please post clear, detailed pictures of both sides of the board, showing your soldering and you connections to the Pi

tistar73
 
Posts: 4
Joined: Fri Jun 06, 2014 11:35 am

Re: Use 16-Channel 12-bit PWM/Servo Driver

Post by tistar73 »

Photo
Photo
IMG_20140702_170124.jpg (45.46 KiB) Viewed 372 times
The Red Cable is 3.3v.
The Yellow Cable is SDA.
The Orange Cable is SCL.
The Black Cable is GND.

Alimentation is connected to 5v.

If I put LED on A and B hole (GND and V+) the light come on.

The command:

Code: Select all

I2cdetect -y 1
return to me 0x40 value (the board is correctly connected).

Now I put the led on A and C hole (GND and PWM) and send the Servo_Driver.py script.

BUT nothing happens...

Is possible to send a command only to turn on the LED?

tistar73
 
Posts: 4
Joined: Fri Jun 06, 2014 11:35 am

Re: Use 16-Channel 12-bit PWM/Servo Driver

Post by tistar73 »

RESOLVED!!!

Code: Select all

#!/usr/bin/python
from Adafruit_PWM_Servo_Driver import PWM
import sys

if len(sys.argv) == 3:
        canale = int(sys.argv[1])
        valore = int(sys.argv[2])
else:
        print 'usage: sudo ./PWM.py 0-15 0-4095'
        sys.exit(1)

pwm = PWM(0x40, debug=False)
pwm.setPWM(canale, 0, valore)
With this program I can command all channels.

Thanks for help!

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”