Show Posts
Pages: 1 ... 38 39 [40]
586  Forum 2005-2010 (read only) / Interfacing / Re: SD21 problems on: January 22, 2011, 01:22:09 pm
Paul, sorry my language problems, I don't use english very often, so I might miss some points. Your reply #1 was before quote, so I didn't saw it, sorry!

I see that you want to be hard to handle, but no worries, I don't mind. Instead of waiting to get any help from you, I can say that problem is solved... at least with Romeo it worked, don't understand why it didn't work with duemilanove?

As I don't have much experience with these little wonders and C-language, it took a while make things familiar.
At first, base address for SD21 seems to be 0x61, instead of 0xC2. Then I had to start thinking integers in two bytes, that helped a lot. Example code tell that you can give low byte in milliseconds, well... anyone can see (after well sleeped night) that 800ms can't be expressed within one byte. After that it was clear. I needed simply to devide that number in to two bytes, and give it to SD21 in two parts.

What I didn't remember to try, was that if these registers can be controlled sequentally, between begin- and end translation? Well, I'm sure that will be clear to me soon.

My simple code follows here, thanks!
Kari


**************************************



#include <Wire.h>
#define SD21 0x61 //SD21 I2C Address, shifted by one bit from 0xC2

void setup()
{
Wire.begin(); // start I2C
Serial.begin(9600);

Wire.beginTransmission(SD21);
Serial.print(" Set Speed 0 for servo1");
Wire.send(0); //Servo1 Speed register 0
Wire.send(0); // Set speed Servo1
Wire.endTransmission();
}

void loop()
{
Serial.print("To right ");

//Right side, 100111001000=2504ms
Wire.beginTransmission(SD21);
Wire.send(1);  //Low Byte to Register1 for pulse lenght
Wire.send(200);
Wire.endTransmission();

Wire.beginTransmission(SD21);
Wire.send(2); // High Byte to Register2 for pulse lenght
Wire.send(9); //
Wire.endTransmission();

 
delay(1500);


Serial.print("Middle position ");

Wire.beginTransmission(SD21);
Wire.send(1);  //Low Byte to Register1
Wire.send(255);
Wire.endTransmission();

Wire.beginTransmission(SD21);
Wire.send(2); // High Byte to Register2 for pulse lenght
Wire.send(5);
Wire.endTransmission();

 
delay(1500);

Serial.print("To left ");

//Left side, 1101000110=838ms
Wire.beginTransmission(SD21);
Wire.send(1);
Wire.send(70);
Wire.endTransmission();

Wire.beginTransmission(SD21);
Wire.send(2);
Wire.send(3);
Wire.endTransmission();


Wire.requestFrom(SD21>>1, 1 );
while(Wire.available())

{ ; }

int b = Wire.receive();
}

587  Forum 2005-2010 (read only) / Interfacing / Re: SD21 problems on: January 22, 2011, 11:02:34 am
Hmm, interesting...

Why didn't you say that in the first place?

Here is the code I tried, with no luck:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1224719165

Here is a link to technical information:
http://www.robot-electronics.co.uk/htm/sd21tech.htm

So far, seems like the card itself is ok, at least our both cards are functioning the same way.

We have separate power for servos, microcontroller get power from Arduino.

I will gladly answer your questions if you need more information.

Thanks
Kari
588  Forum 2005-2010 (read only) / Interfacing / Re: SD21 problems on: January 22, 2011, 10:36:28 am
Yes, it is connected.

Now, I came to visit my friend, and we tested my SD21 and his, with Romeo. I2C scanner find both cards from address 97 (hex 61). Still, we can't control servos.

Is there something special about SD21 that we should know?
 :-?

Kari
589  Forum 2005-2010 (read only) / Interfacing / SD21 problems on: January 22, 2011, 01:39:06 am
Hi!

I have a problem with SD21 servo controller. It is probably D.O.A., but it is more likely that I am missing something with the wiring. As this is a first of a kind part for me, I can't be sure of anything.

It's connected to Duemilanove, pins 4 and 5, as I2C device should be, but I2C scanner program doesn't see it, my other devices are found nicely. I have tried this with and without pull-ups, no change.

Controller seems to be alive when I connect servos, they are moved to their center position as expected.

I tried also different ways to power it, external power is used normally for servos.

Control command have no effects, so... maybe it is the interface? This is my first "broken" piece of the puzzle I have got so far.

Any ideas how to test more?

Thanks!
Kari
590  Forum 2005-2010 (read only) / Interfacing / Re: Wii Motion Plus Servo Controller on: August 23, 2010, 09:40:30 am
How about the external power supply, are you running it with the USB-power only?

Kari
Pages: 1 ... 38 39 [40]