Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Cant get my processing sketch to wait for a response from the arduino

$
0
0
I don't think you need to wait for the Ardunio in your code. In just glancing at the code (Forgive me but you did not explain what you really are trying to do, so I am lazy.) it looks like you are calculating a value that is sent to the Ardunio. You have yet to figure out how to get something back from the Ardunio.  You have decided it will be values in the 300 range. It looks like you have not shown what happens with those 300 range values.

Why does the main loop (the draw) need to wait? Why can it not just continue to do what it has been doing just like any other Processing draw loop?  That is what you want it to do so that it can continue to do something else, if it needs to. That is the key, "if it needs to". You need to devise the switching functions and its supports. There are bunch of examples posted to one of the other posted serial/ardunio questions that might help. You also might be looking at bufferUntil() the wrong way.  

Viewing all articles
Browse latest Browse all 1768

Trending Articles