Button connection from Arduino to Processing

Usually if you are using serial output to talk to an application (e.g. Processing) on the PC you can’t use serial output to see what your Ard sketch is doing. (Yes, you could use text output and the make the application use that, or you could design the protocol so it ignores the information print, but I think you’re not doing any of that.) If you have information prints, they will probably mess up your comms.

You have an Arduno Mega, and one fun thing about that is it has 3 extra serial ports. See labels TX1, RX1 etc. I suggest you buy one (better 3) of TTL to USB adaptor (That’s the right item, not recommending that shop, lots on ebay and elsewhere.) Connect that to Mega with 3 wires RX to TX, TX to RX, Gnd to Gnd, connect to PC and another COM port will appear. In the Mega you can use e.g. Serial1.write. If you connect Processing to that you don’t have to stop the sketch to reload the Mega. The serial port you’re using now can be for reloading and Serial Monitor.

1 Like