Society of Robots - Robot Forum

Software => Software => Topic started by: madsci1016 on January 05, 2010, 09:31:45 PM

Title: Webbot Lib, Uart, How to send string of bytes?
Post by: madsci1016 on January 05, 2010, 09:31:45 PM
I am just switching my code to use Webbot lib instead of Admin's library.

The pdf doesn't seem to mention a function similiar to

 uartSendBuffer();

from admin's library.

Is there a similar function? Is there another technique to send a string of information? How do i load the uart Send buffer with a string of values?

Or is my only option to loop uartSendByte();?

Thanks guys, I'm sure this is just one of those "I'm missing something obvious".

Title: Re: Webbot Lib, Uart, How to send string of bytes?
Post by: Admin on January 06, 2010, 02:16:58 AM
Look at my Axon II example code. ::)
Title: Re: Webbot Lib, Uart, How to send string of bytes?
Post by: madsci1016 on January 06, 2010, 05:19:17 PM
I'm searching your website, but I seem to be blind. Where is your Axon 2 code?

Never mind, I am blind.
Title: Re: Webbot Lib, Uart, How to send string of bytes?
Post by: madsci1016 on January 06, 2010, 07:05:13 PM
I just went through all the Axon 2 example code, and i do not see what i was looking for. (sending a buffer of bytes with one command)

Where do you have an example of this, Admin?
Title: Re: Webbot Lib, Uart, How to send string of bytes?
Post by: Admin on January 06, 2010, 08:25:09 PM
I'm not entirely sure what you are trying to do or why . . .

rprintf isn't it?

Did you search the WebbotLib manual?
Title: Re: Webbot Lib, Uart, How to send string of bytes?
Post by: madsci1016 on January 06, 2010, 08:36:50 PM
When i used your lib Admin, you had a function "uartSendBuffer()" that would load a buffer of a specified size into the TX buffer of a uart and send it out. I believe this was a faster way to send a packet of bytes faster then just calling "uartSendByte()" repeatedly. Is there anything like that in webbot lib?

I am trying to send a 4 byte packet to my custom motor-controller.

Right now i do this:

Code: [Select]
motor_str_out[0] = 'C';
motor_str_out[1] = left;
motor_str_out[2] = right;
motor_str_out[3] = '*';

for(int i = 0; i < 4; i++)
uartSendByte(MOTOR_COM, motor_str_out[i]);

and it works, but i think it would be more efficient to use a uartSendBuffer() equivalent with a pointer to the address for the array.
Title: Re: Webbot Lib, Uart, How to send string of bytes?
Post by: Admin on January 06, 2010, 09:39:25 PM
I don't seem to see a feature like this in the WebbotLib manual, so you'll have to request it from Webbot.

Or just take out the relevant code from my original Axon code and add it to yours.