Help with serial 8servo controller pololu mode

hello i have a problem with the pololu code writing, he is working without errors but the controller is not responding.
I think that im not writing right in the pololu mode.
can some one help me please?

/* ------------------------------------------------------------------------ --
--                                                                          --
--                  Application example for using Tserial_event             --
--                                                                          --
--                                                                          --
--                                                                          --
--  Copyright @ 2001-2002     Thierry Schneider                             --
--                            thierry@tetraedre.com                         --
--                                                                          --
--                                                                          --
--                                                                          --
-- ------------------------------------------------------------------------ --
--                                                                          --
--  Filename : serialtest.cpp                                               --
--  Author   : Thierry Schneider                                            --
--  Created  : April 8th 2001                                               --
--  Modified : January 30th 2002                                            --
--  Plateform: Windows 95, 98, NT, 2000 (Win32)                             --
-- ------------------------------------------------------------------------ --
--                                                                          --
--  This software is given without any warranty. It can be distributed      --
--  free of charge as long as this header remains, unchanged.               --
--                                                                          --
-- ------------------------------------------------------------------------ --
--                                                                          --
--  01.04.24    # ifdef __BORLANDC__ added in the header                    --               
--                                                                          --
-- 02.01.30      Version 2.0 of the serial event object                     --
--                                                                          --
--                                                                          --
-- ------------------------------------------------------------------------ */




/* ---------------------------------------------------------------------- */
#ifdef __BORLANDC__
#pragma hdrstop             // borland specific
#include <condefs.h>
#pragma argsused
USEUNIT("Tserial_event.cpp");
//---------------------------------------------------------------------------
#endif

//---------------------------------------------------------------------------
#include "conio.h"
#include "Tserial_event.h"
#include "windows.h"

/* ======================================================== */
/* ===============  OnCharArrival     ===================== */
/* ======================================================== */
void OnDataArrival(int size, char *buffer)
{
    if ((size>0) && (buffer!=0))
    {
        buffer[size] = 0;
        printf("OnDataArrival: %s ",buffer);
    }
}

/* ======================================================== */
/* ===============  OnCharArrival     ===================== */
/* ======================================================== */
void SerialEventManager(uint32 object, uint32 event)
{
    char *buffer;
    int   size;
    Tserial_event *com;

    com = (Tserial_event *) object;
    if (com!=0)
    {
        switch(event)
        {
            case  SERIAL_CONNECTED  :
                                        printf("Connected ! \n");
                                        break;
            case  SERIAL_DISCONNECTED  :
                                        printf("Disonnected ! \n");
                                        break;
            case  SERIAL_DATA_SENT  :
                                        printf("Data sent ! \n");
                                        break;
            case  SERIAL_RING       :
                                        printf("DRING ! \n");
                                        break;
            case  SERIAL_CD_ON      :
                                        printf("Carrier Detected ! \n");
                                        break;
            case  SERIAL_CD_OFF     :
                                        printf("No more carrier ! \n");
                                        break;
            case  SERIAL_DATA_ARRIVAL  :
                                        size   = com->getDataInSize();
                                        buffer = com->getDataInBuffer();
                                        OnDataArrival(size, buffer);
                                        com->dataHasBeenRead();
                                        break;
        }
    }
}
/* ======================================================== */
/* ========================   main  ======================= */
/* ======================================================== */
int main(int argc, char* argv[])
{
    int            c,d;
    int            erreur;
   	char a[8];
    char b[4]; 
	Tserial_event *com;

	 c=0;
	 d=0;

[b]	 a[0]=128;
	 a[1]=1;
	 a[2]=4;
		 a[3]=6;
	 a[4]=19;
	a[5]=136;
//	a[6]=0;
	a[6]='\0';
	[/b]	 	 
	 
	  //printf("haim ata ahabal %s\n ", a);
 //printf("%s\n ", b);
scanf("%d\n ", c);
  printf("%d\n ", c);
//a[2]=c;
 printf("%s\n ", a);
 scanf("%d\n ", d);
  printf("%d\n ", d);
b[2]=d;
 printf("%s\n ", b);*/
 com = new Tserial_event();
    if (com!=0)
    {
        com->setManager(SerialEventManager);
        erreur = com->connect("COM1", 9600, SERIAL_PARITY_NONE, 8, true);
        if (!erreur)
        {
			while(1){
		a[3]=21;		
		a[4]=124;
		
	com->sendData(a,strlen(a)+1);
	printf("d");
		  //  Sleep(1);
			com->sendData(b,strlen(b)+1);
        Sleep(1000);
			a[2]=0;
			com->sendData(a,strlen(a)+1);
  Sleep(1000);
	    Sleep(1000);
			b[2]=0;
			com->sendData(b,strlen(b)+1);
  Sleep(1000);
		com->setRxSize(1);
			}

       }
        else
            printf("ERROR : com->connect (%ld)\n",erreur);
        // ------------------
        com->disconnect();

        // ------------------
        delete com;
        com = 0;
    }
    return 0; 
}

Hello,

Is the Mini SSC II mode working for you? In that mode, all servos should go to netural after you send the first byte, so you can at least verify that your electrical connections and power supply are good.

- Jan

no i ned to controller in pololu mode .
is the next mode with serial 8 servo

I have no idea what you are saying. Even if you need to use Pololu mode eventually, you can still initially do some testing with the simpler protocol.

- Jan

in mini ssc II mode I know how to move the servo and evrything working good.
thanks you.

Does that mean you’re all set now? Did you get Pololu mode working too, are did you decide you don’t need it?

- Jan

Hi Jan

The mini ssc is working but the pololu mode is not.
Do you have a example code that work in command 4.

thanks,
Derei.

There is an example with command 4 in the using the pololu servo controller with the BASIC Stamp 2 document.

- Jan