Author Topic: Webbot Lib, Uart, How to send string of bytes?  (Read 5044 times)

0 Members and 1 Guest are viewing this topic.

Offline madsci1016Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
    • Personal Website
Webbot Lib, Uart, How to send string of bytes?
« 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".


Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Webbot Lib, Uart, How to send string of bytes?
« Reply #1 on: January 06, 2010, 02:16:58 AM »
Look at my Axon II example code. ::)

Offline madsci1016Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
    • Personal Website
Re: Webbot Lib, Uart, How to send string of bytes?
« Reply #2 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.
« Last Edit: January 06, 2010, 05:37:18 PM by madsci1016 »

Offline madsci1016Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
    • Personal Website
Re: Webbot Lib, Uart, How to send string of bytes?
« Reply #3 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?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Webbot Lib, Uart, How to send string of bytes?
« Reply #4 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?

Offline madsci1016Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
    • Personal Website
Re: Webbot Lib, Uart, How to send string of bytes?
« Reply #5 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.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Webbot Lib, Uart, How to send string of bytes?
« Reply #6 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.

 


Get Your Ad Here