mech_eng

Hey all, I'm having issue sending commands to an Arduino via processing. The commands take the form of <case><mag>. Right now I'm just trying to vary the brightness of an LED but will eventually use this to control an ROV. If i send <1><255> to the Arduino from the Arduino Serial Monitor it works fine. Sending from processing is not working however. I've attached the code below.

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.