working with an RTC, and want to send it a string via a processing program. The string would be a unix timestap followed by a '!'
ive actually just solved it (-_-), but i now have the problem of converting a String object, to an int, im just doing some googleing right now. Im thinking of using the toCharArray() function, and then converting that to an integer, just gotta find out how it was that was done
so far, the string thing is done by a modified version of the serialEvent example
void serialEvent()
{
 while (Serial.available())
 {
  if(Serial.peek() == '!')
  {
   Serial.read();
   stringComplete = true;
  }
  else
  {
   char inChar = (char)Serial.read();
   // add it to the inputString:
   inputString += inChar;
  }
 }
}
You could use the String::toCharArray() function and then the atoi() function to get an int from a String. Or you could use the String::toInt() function.
int(sameVariable) is exactly the same as (int)someVariable (which is the proper way to perform a cast).
It tells the compiler to treat the variable as an int, even though the variable is not an int. You might do this if you have a long that you KNOW contains a value that fits in an int that you want to pass to a function that only takes ints.
It will NOT convert a string or a String to an int, no matter what the string or String contains.