Built-in servo and servo shield

Discussion related to "under the hood" OpenMV topics.
lab
Posts: 18
Joined: Wed Mar 21, 2018 9:02 pm

Built-in servo and servo shield

Postby lab » Thu Mar 22, 2018 11:19 pm

What is the different between the three servos in the OpenMV and servo shield? If I have only three servos to connect, can I use the built-in servos? Is it possible to use GPIOs to connect to servos? My servos use current: 100mA; voltage: 5-7.2V
User avatar
kwagyeman
Posts: 2111
Joined: Sun May 24, 2015 2:10 pm

Re: Built-in servo and servo shield

Postby kwagyeman » Thu Mar 22, 2018 11:37 pm

Hi, you can't power the servos from the OpenMV Cam. You need another 5v supply.

Anyway, the servo shield just provides a way to drive servos using I2C control via another chip which saves I/O pins.

The built in 3 servo channels use your IO pins.

Choose whichever you want.
Nyamekye,
lab
Posts: 18
Joined: Wed Mar 21, 2018 9:02 pm

Re: Built-in servo and servo shield

Postby lab » Fri Mar 23, 2018 6:40 pm

Sure I will connect an external 5V supply. Apart from using Serv1, serv2, serv3 pins (Pins 7,-9) on board, is there anyway I can connect three more servos on pins 1-6 and use servo commands?
s1 = Servo(?); s1.angle(45)
User avatar
kwagyeman
Posts: 2111
Joined: Sun May 24, 2015 2:10 pm

Re: Built-in servo and servo shield

Postby kwagyeman » Sat Mar 24, 2018 12:00 am

The purpose of the servo shield is to allow you to connect more more servos. The other pins don't have PWM timers configured for servo control.
Nyamekye,
lab
Posts: 18
Joined: Wed Mar 21, 2018 9:02 pm

Re: Built-in servo and servo shield

Postby lab » Sat Mar 24, 2018 1:36 am

Thanks. How do we program the servo shield connected through I2C?
https://openmv.io/collections/shields/p ... rvo-shield

s1 = Servo(1) # servo on position 1 (P7)
s1.angle(45) # move to 45 degrees
s1.angle(-60, 1500) # move to -60 degrees in 1500ms
s1.speed(50) # for continuous rotation servos
User avatar
kwagyeman
Posts: 2111
Joined: Sun May 24, 2015 2:10 pm

Re: Built-in servo and servo shield

Postby kwagyeman » Sat Mar 24, 2018 1:23 pm

Hi, see the Examples folder -> Servo Shield. There's a demo script for the shield in there.
Nyamekye,
lab
Posts: 18
Joined: Wed Mar 21, 2018 9:02 pm

Re: Built-in servo and servo shield

Postby lab » Sun Mar 25, 2018 1:57 am

Thank you.

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests