Society of Robots - Robot Forum
Software => Software => Topic started 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.
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
-
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
bufferPut(&recieveBuffer,ch);
will keep the project updated when I can.
T