Processing to read Arduino

Hello,

If you are using the Processing Serial library these are the Processing references:

There are numerous topics on the Internet on Arduino and Processing communication.

This is a simple working example:

Arduino
int i;

void setup() 
  {
  Serial.begin(9600);  //Begin Serial Communication with a baud rate of 9600
  }
void loop() 
  {  
  Serial.print(i);
  Serial.print('\n');
  i++;
  if (i>1023) i = 0;
  delay(100);
  }

Processing side:
https://processing.org/reference/libraries/serial/Serial_readStringUntil_.html

Also you will need to trim() myString before converting it to an int or float.

References:

:)

1 Like