I was hoping to get servos to work with the trinket m0 and a pca9685 board, but I'm not having sucess.
I'm prototyping on a breadboard
trying to duplicate what it says on this page https://learn.adafruit.com/16-channel-p ... cuitpython
here is my set up
Pin 0 on trinket to SDA pin on pca9685
Pin 2 on trinket to SCL pin on pca9685
10k resister from Pin 0 on trinket to pin 3v on trinket (pull up)
10k resister from Pin 2 on trinket to pin 3v on trinket (pull up)
4.5 volt power to trinket gnd and bat
6 volt power to pca9685
servo hooked up to channel 0 on pca9685
Here is my code
1 """Simple test for a standard servo on channel 0 and a continuous rotation servo on channel 1."""
2 import time
3 from adafruit_servokit import ServoKit
4 print ("hello")
5 # Set channels to the number of servo channels on your kit.
6 # 8 for FeatherWing, 16 for Shield/HAT/Bonnet.
7 kit = ServoKit(channels=16)
8
9 kit.servo[0].angle = 180
10 # kit.continuous_servo[1].throttle = 1
11 time.sleep(1)
13 # kit.continuous_servo[1].throttle = -1
I was hoping to get servos to work with the trinket m0 and a pca9685 board, but I'm not having sucess.
I'm prototyping on a breadboard
trying to duplicate what it says on this page https://learn.adafruit.com/16-channel-p ... cuitpython
here is my set up
Pin 0 on trinket to SDA pin on pca9685
Pin 2 on trinket to SCL pin on pca9685
10k resister from Pin 0 on trinket to pin 3v on trinket (pull up)
10k resister from Pin 2 on trinket to pin 3v on trinket (pull up)
4.5 volt power to trinket gnd and bat
6 volt power to pca9685
servo hooked up to channel 0 on pca9685
Here is my code
"""Simple test for a standard servo on channel 0 and a continuous rotation servo on channel 1."""
import time
from adafruit_servokit import ServoKit
print ("hello")
# Set channels to the number of servo channels on your kit.
# 8 for FeatherWing, 16 for Shield/HAT/Bonnet.
kit = ServoKit(channels=16)
kit.servo[0].angle = 180
# kit.continuous_servo[1].throttle = 1
time.sleep(1)
# kit.continuous_servo[1].throttle = -1
time.sleep(1)
kit.servo[0].angle = 0
# kit.continuous_servo[1].throttle = 0
There error I get is... (wait! What? MU won't let me copy and past the error)
here is the short version
ValueError: No I2c device at address: 40
This makes me think that the trinket can't see the pca9685 for some reason. I checked the jumper pads on the pca9685 to see if it was on a different address, and it seems to be on at address 40.
also I was able to get the same pca9685 to work with my arduino uno so I'm pretty sure it works.
any suggestions? I must be missing something simple.
-dale
time.sleep(1)
kit.servo[0].angle = 0
# kit.continuous_servo[1].throttle = 0
There error I get is... (wait! What? MU won't let me copy and past the error)
here is the short version
ValueError: No I2c device at address: 40
This makes me think that the trinket can't see the pca9685 for some reason. I checked the jumper pads on the pca9685 to see if it was on a different address, and it seems to be on at address 40.
also I was able to get the same pca9685 to work with my arduino uno so I'm pretty sure it works.
any suggestions? I must be missing something simple.
-dale
trinket M0 and pca9685 not working
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_carter
- Posts: 29168
- Joined: Tue Nov 29, 2016 2:45 pm
Re: trinket M0 and pca9685 not working
Try removing the pull up resistors. They are not needed, the PCA breakout includes them.
Then please post a photo of your setup showing how everything is connected.
Then please post a photo of your setup showing how everything is connected.
- everettdale
- Posts: 14
- Joined: Tue Mar 01, 2016 2:50 pm
Re: trinket M0 and pca9685 not working
I tried removing the resistors and got an error saying pull up resistors needed. I also swapped out the pca9685 with a different one, to see if it was bad, still no luck. I will post a photo soon.
- everettdale
- Posts: 14
- Joined: Tue Mar 01, 2016 2:50 pm
Re: trinket M0 and pca9685 not working
Here are some (not great) photos of my set up.
I hope these are good enough.
I hope these are good enough.
- adafruit_support_carter
- Posts: 29168
- Joined: Tue Nov 29, 2016 2:45 pm
Re: trinket M0 and pca9685 not working
Thanks for the photos. It looks like you don't have logic power connected:
https://learn.adafruit.com/16-channel-p ... wiring-9-1
and here for general pinout info:
https://learn.adafruit.com/16-channel-p ... er/pinouts
There are two separate power sources: (1) power for the servos which is connected via the screw terminals and (2) power for the PCA9685 itself.
See here for wiring details:https://learn.adafruit.com/16-channel-p ... wiring-9-1
and here for general pinout info:
https://learn.adafruit.com/16-channel-p ... er/pinouts
There are two separate power sources: (1) power for the servos which is connected via the screw terminals and (2) power for the PCA9685 itself.
- everettdale
- Posts: 14
- Joined: Tue Mar 01, 2016 2:50 pm
Re: trinket M0 and pca9685 not working
it worked!
I don't see a way to tag this thread as SOLVED
Thanks!
I don't see a way to tag this thread as SOLVED
Thanks!
Please be positive and constructive with your questions and comments.