Post date: Aug 21, 2010 11:35:46 PM
The punctuation and handshaking methods are two ways to organize and make sense of data sent from multiple inputs. In Arduino, the punctuation method creates a new line of values every time the loop function runs, making the serial monitor more orderly and easy to read. In Processing the values are read and control the sketch in a much more understandable fashion. The handshaking method sets up a system of communication in which the Arduino will run the establishContact function until it senses that there is new serial data available. When it does, it will switch over to the void loop function and run it as long as there is new data to be read. Processing will "ask" Arduino for data in the serialEvent function and when it receives said data it will print the values and control the sketch in the same way as the punctuation method.
Both methods are extremely useful and make using multiple sensors much more understandable. Although both are very effective, one is most likely better than the other; which one depends on the specific situation. This is mainly because the punctuation method is simpler but runs continuously. If the situation allows, the simpler method would be ideal. However, sometimes the more intricate solution is required.