Adafruit CircuitPython ServoKit => Continuous Rotation Servo

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Tricia279
 
Posts: 4
Joined: Thu Jul 02, 2020 7:36 am

Adafruit CircuitPython ServoKit => Continuous Rotation Servo

Post by Tricia279 »

Hi,
while we try to use your code:
kit.continuous_servo[1].throttle = 1
it is not working.

We got the following error:
kit.continuous_servo[servo_cha].throttle = 1
File "/home/raspy/.local/lib/python3.8/site-packages/adafruit_servokit.py", line 180, in __getitem__
raise ValueError("Channel {} is already in use.".format(servo_channel))
ValueError: Channel 0 is already in use.
The servo_cha is a variable.

We appreciate your help very much.

KR
Robert

User avatar
tannewt
 
Posts: 3315
Joined: Thu Oct 06, 2016 8:48 pm

Re: Adafruit CircuitPython ServoKit => Continuous Rotation S

Post by tannewt »

Please post your full code.

User avatar
Tricia279
 
Posts: 4
Joined: Thu Jul 02, 2020 7:36 am

Re: Adafruit CircuitPython ServoKit => Continuous Rotation S

Post by Tricia279 »

Hello tannewt,
sorry for the delay.
Beside you will find the full code.
Please tell me, if you checked it, why it is not working and who did the mistake.
Thank you for your help.
KR
Robert
alias Tricia279
Attachments
20210429_Error_CirquitPython_PCA9685.py
(3.26 KiB) Downloaded 3 times

User avatar
tannewt
 
Posts: 3315
Joined: Thu Oct 06, 2016 8:48 pm

Re: Adafruit CircuitPython ServoKit => Continuous Rotation S

Post by tannewt »

I suspect you are mixing `.servo` and `.continuous_servo` for the channel that errors. That's what causes the in use error: https://github.com/adafruit/Adafruit_Ci ... it.py#L180

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

Return to “Adafruit CircuitPython”