Send commands to Arduino from Processing

  arduino.write((byte)R);

Unlike the Serial class on the Arduino, the Serial class in Processing does not distinguish between ASCII data and binary data with separate functions. Processing has one method, write(). If you write() a byte, it is binary data. If you write() an int, it is binary data. If you write() a string, it is still binary data, but that binary data contains ASCII values.

It's good that you figured out a solution. I just thought you might to want to know why you had the problem.