Example #1
0
int InitDXL(int deviceIndex, int baudnum ) {
  if(dxl_hal_open(deviceIndex, GetBaudRate(baudnum)) == 0) {
    return 0;
  }

  return 1;
}
Example #2
0
int dxl_initializeBaud( int devIndex, float baudrate ) 
{
	if( dxl_hal_open(devIndex, baudrate) == 0 )
		return 0;

	gbCommStatus = COMM_RXSUCCESS;
	giBusUsing = 0;
	return 1;

}
int dxl_initialize( int devIndex, int baudnum )
{
	float baudrate;	
	baudrate = 2000000.0f / (float)(baudnum + 1);
	
	if( dxl_hal_open(devIndex, baudrate) == 0 )
		return 0;

	gbCommStatus = COMM_RXSUCCESS;
	giBusUsing = 0;
	return 1;
}
Example #4
0
// Initialize communication
int dxl_initialize( int devIndex, int baudnum )
{
	// set baud rate based on the baud number table 
	float baudrate;	
	baudrate = 2000000.0f / (float)(baudnum + 1);
	
	// open serial communication
	if( dxl_hal_open(devIndex, baudrate) == 0 )
		return 0;

	// show success and bus as free
	gbCommStatus = COMM_RXSUCCESS;
	giBusUsing = 0;
	return 1;
}
Example #5
0
int dxl_initialize( int devIndex, int baudnum )
{
	int baudrate;
	baudrate = 2000000 / (baudnum + 1);
	//baudrate = BaudrateMapping(baudnum);

	if( dxl_hal_open(devIndex, baudrate) == 0 )
		return 0;

	gbCommStatus = COMM_RXSUCCESS;
	giBusUsing = 0;
	//gpio_set_mode(PORT_TXRX_DIRECTION, PIN_TXRX_DIRECTION, GPIO_OUTPUT_PP);
	ClearBuffer256();

	gbIsDynmixelUsed = 1;  //[ROBOTIS]2012-12-13 to notify end of using dynamixel SDK to uart.c

	/*while(1) //Test codes in dynamixel echo example
	{

		//TxDStringC("test\r\n");
		//TxByteToDXL('a');

		//gpio_write_bit(PORT_TXRX_DIRECTION, PIN_TXRX_DIRECTION, 1 );// TX Enable
		//TxByteToDXL('h');
		//gpio_write_bit(PORT_TXRX_DIRECTION, PIN_TXRX_DIRECTION, 0 );// TX Enable

		if(CheckNewArrive())
		{

			//TxDStringC("new\r\n");
			gpio_write_bit(PORT_TXRX_DIRECTION, PIN_TXRX_DIRECTION, 1 );// TX Enable
			//gpio_write_bit(PORT_ENABLE_TXD, PIN_ENABLE_TXD, 1 );// TX Enable
			//	gpio_write_bit(PORT_ENABLE_RXD, PIN_ENABLE_RXD, 0 );// RX Disable
			TxByteToDXL( RxByte());
			//TxDByteC(RxByte());
			//gpio_write_bit(PORT_ENABLE_TXD, PIN_ENABLE_TXD, 0 );// TX Enable
			//	gpio_write_bit(PORT_ENABLE_RXD, PIN_ENABLE_RXD, 1 );// RX Enable
			//TxDStringC("new\r\n");
			//TxByteToDXL('a');
			//TxDByteC(RxByte());
			gpio_write_bit(PORT_TXRX_DIRECTION, PIN_TXRX_DIRECTION, 0 );// TX Enable
		}


	}*/

	return 1;
}