title: Arduino timed void draw() loops
body: <p>I have an Arduino Uno set up to sense the light level and draw to a text file via Processing when it gets dark.  I'd like to modify the Processing code to interrupt the draw loop for five seconds and then restart the draw loop.  This will continuously write and overwrite the .txt file but that's not important right now.</p>
  
  <p>The purpose of this excercise is to understand how to insert a break into the endless draw loop.  I'm still very much a newbie to programming and am trying to wrap my head around how commands interact with eath other.  Can anyone help me understand how to make this work?  Eample code would be great but I'd also be happy with a conceptual description of how it's supposed to work...learn by doing and all.</p>
  
  <p>I've tried putting the void draw() loop within a void loop() but it erred out.  Am I on the right path?</p>
  
  <pre><code>&lt;setup...mySerial and createWriter to path/file.txt&gt;{
  }
  
  void draw() { //this is what needs to terminate &amp; restart
  if (mySerial.available() &gt; 0 ) {
  String value = mySerial.readString();
  if ( value != null ) {
  output.println( value );
  }
  }
  }
  
  void keyPressed and end
  </code></pre>