examples/basics/sketch.js
function gotData() {
  var currentString = serial.readLine();  // read the incoming string
  trim(currentString);                    // remove any trailing whitespace
  if (!currentString) return;             // if the string is empty, do no more
  console.log(currentString);             // println the string
  latestData = currentString;            // save it for the draw method
}
function gotData() {
  var currentString = serial.readLine();  // read the incoming string
  trim(currentString);                    // remove any trailing whitespace
  if (!currentString) return;             // if the string is empty, do no more
  console.log(currentString);             // println the string
  latestData = currentString;            // save it for the draw method
}
function gotData ( ) { var currentString = serial . readLine ( ) ; // read the incoming string trim ( currentString ) ; // remove any trailing whitespace if ( ! currentString ) return ; // if the string is empty, do no more console . log ( currentString ) ; // println the string latestData = currentString ; // save it for the draw method }
There is data available to work with from the serial port
There is data available to work with from the serial port