Society of Robots - Robot Forum

Software => Software => Topic started by: totalis on July 17, 2012, 09:59:56 AM

Title: Webbotlib buffer and uartAttach
Post by: totalis on July 17, 2012, 09:59:56 AM
Hi guys,

I have been working on a Labview project to interface with arduino, using webbotlib.

I have setup a basic control loop to update the IO each 10ms, i am trying to attach a callback to UART0 so that i can capture 8 characters and use them as the instruction.

Code: [Select]
void myReceive(unsigned char data, void* device){
ch = uartGetByte(UART0);
if(ch == -1){
uartSendByte(UART0,122);
}
else{
uartSendByte(UART0,114);
}
bufferPut(&recieveBuffer,ch);
}

The above code tries to get a byte from the UART buffer and then tests it to see if it was correct, so far all of the data has been incorrect ie ch == -1.

how do i capture the incoming byte?

Thanks

T
Title: Re: Webbotlib buffer and uartAttach
Post by: totalis on July 18, 2012, 09:23:54 AM
turns out that the data value called "unsigned char data" is the data sent from uart, and aside from the '&' infront of the ch in

Code: [Select]
bufferPut(&recieveBuffer,ch);
will keep the project updated when I can.

T