go away spammer

Author Topic: Webbotlib buffer and uartAttach  (Read 1661 times)

0 Members and 1 Guest are viewing this topic.

Offline totalisTopic starter

  • Full Member
  • ***
  • Posts: 89
  • Helpful? 0
Webbotlib buffer and uartAttach
« 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

Offline totalisTopic starter

  • Full Member
  • ***
  • Posts: 89
  • Helpful? 0
Re: Webbotlib buffer and uartAttach
« Reply #1 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

 


Get Your Ad Here

data_list