View Single Post
  #5   Spotlight this post!  
Unread 18-06-2012, 21:04
apples000's Avatar
apples000 apples000 is offline
Registered User
no team
 
Join Date: Mar 2012
Rookie Year: 2012
Location: United States
Posts: 222
apples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant future
Re: Arduino and cRIO serial connection

Thanks for the quick reply! I understand how it works, but I am unsure how I would go about storing the transmitting information to a variable. From what I understand, it sends one character at a time. Then, for the last one, it will send the end of the line. I think that if I wanted to store the string, I would have to add all of the letters together, then stop when I got the new line. For what I am trying to do, I would like to send several integers. If I sent three integers separated by commas (12,45,65), could I read it using

Code:
void receiveEvent(int howMany)
{
  while(Wire.available()) 
  {
 int a = Wire.parseint(); 
 int b = Wire.parseint(); 
 int c = Wire.parseint(); 

         
  }
  
}