Loading...
Logo
Processing Forum
Hello

I'm having some problems with my serial communication between my Processing and my Arduino. I believe my main problem is within my Processing. I feel like I put everything accordingly but it gives a such problem.

This is my code
Copy code
  1.  //println (get(mouseX, mouseY) );                          // Print line the location of the mouse on-screen.
  2.  if (get(mouseX, mouseY) == color (255, 0, 0) ) {        // If it is within a color range of red.
  3.     //println("red");                                        // Print line red.
  4.     key = 'a';
  5.     cntrPair1.value++;                                     // Then decrement number on-screen by one.
  6.     delay(150); 
  7.     // Delay of 200 milliseconds between allowable clicks.
  8.  Serial.print('a');
  9.   }
I seem to have put in everything which was needed to start the communication but the problem is from the serial.print. That would be grateful if you can help.


Thanks 

Replies(1)

Serial.print('a');
expects a static function in the Serial class, ie. a function using no fields from the class, a bit like random() or sin().
You want a
serial.print('a');
where serial would be the variable holding the instance of the Serial class.