usb-i2c, sd21, problem setting multiple servos

I2C, Serial, Wireless etc.

Moderator: chris

usb-i2c, sd21, problem setting multiple servos

Postby kae » Wed Apr 25, 2012 7:42 pm

hi guys, newbie here.

I have a C program (gb) talking to a USB-I2C bridge which then controls servos on an SD21.

the gb program is based on code found on this site, such that "gb 1 2200" sets the second servo to frequency 2200.

I can run it from the console perfectly, setting whatever servos I want to whatever frequencies, but when I write a bash script to set a few in quick succession, only one gets set.

Any ideas?
kae
 
Posts: 2
Joined: Wed Apr 25, 2012 7:35 pm

Re: usb-i2c, sd21, problem setting multiple servos

Postby chris » Thu Apr 26, 2012 10:19 am

Are you waiting for the USB-I2C returned byte following a packet transmission?
User avatar
chris
 
Posts: 172
Joined: Wed Nov 08, 2006 3:13 pm
Location: Norfolk, England

Re: usb-i2c, sd21, problem setting multiple servos

Postby Gerry » Thu Apr 26, 2012 10:20 am

Make sure you read the returned ACK byte from the USB-I2C after writing.
Discard it if you want, but you must read it.
User avatar
Gerry
Site Admin
 
Posts: 245
Joined: Wed Nov 08, 2006 12:28 pm

Re: usb-i2c, sd21, problem setting multiple servos

Postby kae » Thu Apr 26, 2012 10:27 pm

thanks! that was it. perfect! my bot takes a step towards world domination (http://www.youtube.com/watch?v=1pxOx2Fr3Zc)
kae
 
Posts: 2
Joined: Wed Apr 25, 2012 7:35 pm


Return to Communication devices

Who is online

Users browsing this forum: No registered users and 0 guests

cron