View Single Post
  #23   Spotlight this post!  
Unread 04-29-2012, 03:02 PM
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 328
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: Arduino and kop encoder

Quote:
Originally Posted by purduephotog View Post
You are blocking what here- or are you saying there is a sync here on this. Using java there is the observer observable classes that I found handled serial come quite nicely.
We're not using Java, but rather C++. Nonetheless, the blocking is in a thread that simply reads from the UDP socket (recvfrom() call) using a blocking socket (one not marked as FIONBIO via ioctl()). No synchronization is needed because the thread gives up the CPU when there is no data to be read and the main robot code continues as normal.

HTH,

Mike