go_away

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

0 Members and 1 Guest are viewing this topic.

Offline totalisTopic starter

  • Full Member
  • ***
  • Posts: 86
  • 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: 86
  • 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

 

Related Topics

  Subject / Started by Replies Last post
7 Replies
3320 Views
Last post February 17, 2007, 06:34:22 AM
by JonHylands
5 Replies
3147 Views
Last post September 08, 2007, 08:02:33 AM
by HDL_CinC_Dragon
3 Replies
2621 Views
Last post January 17, 2008, 12:06:27 PM
by Admin
0 Replies
1550 Views
Last post February 23, 2008, 08:09:12 PM
by frank26080115


Get Your Ad Here