There are three different examples presented in a response to "serial problem in reading a string" for Ardunio to Processing communication schemes. Maybe they can help. You have an interesting project. Now after seeing your code I am struck by the fact the plotting data is sent as consecutive data instead of as addressed data. What I mean by that is that I wonder if your plotter can actually plot to a coordinate location. Because if it can then why not send the coordinate information with the image information. For example "PL x y image data". You would be using the SerialCommand library previously mentioned. The callback function for a PL command would plot image data at x y. Incidentally this type of command structure is what HPGL plotters did back in the day and is exactly what you would see when looking at an HPGL plot file before HP adopted a compressed file format. What is interesting is that if you had the Ardunio side echo back the data to Processing then you would have created an essential piece required for the plotter to be a scanner.
↧