Data from PDE to Arduinio IDE on continual basis

"Building" a PDE / IDE connection to pass ongoing and changing data from PC (W10/64) to an Arduino board with an LCD.  Eventual goal is an LCD-display clock.  *My existing code succeeds,up to a  point.*. 
 In the test set-up the send / receive. exchange works for about 25 cycles (1 second per cycle).  The display then repeatedly displays an unchanging character from the string, usually the inital character.  If I restart the PDE  (using the "play" icon)  the send / received / display cycle restarts. 
I use the LCD display output for two reasons:  (1) The goal is an LCD display,   (2) This reduces the problem of a COM port clash between the PDE and IDE;  both use COMM 5.

Code pasted below, I hope with proper easy-to-read format
.
Tom Kane> please format code with </> button * homework policy * asking questions

------------------ PDE --------------------------------
</>// PDE to send-to-port one character for IDE to read and display.
import processing.serial.*;

Serial myPort;

float background_color;

int loop_Count;

char count_Text;

String write_String;

String slc;

void setup () {

size (500, 500); // Size of the serial window (adjust as wish)

myPort = new Serial (this, “COM5”, 9600); // Set the com port and baud

myPort.bufferUntil ( ‘\n’ ); // Receiving the data from the Arduino IDE

loop_Count = 0;

}

void SerialEvent (Serial myPort) {

background_color = float (myPort.readStringUntil ( ‘\n’ ));

}

void draw (){

background (150, 50, background_color); // inital background colour . . .

  loop_Count = loop_Count + 1;


  String slc = ""+loop_Count;

  write_String = slc + " WED";

// write_String = “WED”;

  myPort.write (write_String);                 // send a character to the COMM port

  delay(10000);

}

----------------- IDE ---------------------------
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

char recv_Char = ‘K’;

int analogPin = A0;

int buffer_avail;

void setup() {

Serial.begin(9600);

// Initialise the LCD

lcd.begin(16, 2); //Initialize the 16x2 LCD

}

void loop() {

lcd.clear();

lcd.print(“Read from comm”);

delay(3000);

// variety of codes to try reading from the port

// pick one by üncommented it.

// recv_Char = analogRead(analogPin);

  recv_Char = Serial.read();

//

lcd.clear();

lcd.setCursor(0,0);

lcd.print("recv_Char: ");

lcd.print(recv_Char);

delay(10000);

}

Hi @kmot, You’ve posted the link to asking questions, but you need to do what it says. Please format your code so the whole code appears as code (one for Procesing and one for Arduino). Look at other topics to see how it should be. Then there’s the part about small steps. IMO your project steps should be

  • make Arduino print numbers counting continuously on the serial monitor (Ard IDE ctrl-shift-m)
  • reformat those numbers to what you expect on the LCD
  • put them on the LCD

When that is all working then think what you want the PC and Processing to do. Your choice of words “PDE / IDE connection” indicates confusion to me, PDE = Processing sketch, IDE = Arduino IDE - why would you want them to communicate? It’s very common to make Processing and Arduino communicate and I/others will help you with that.

Please tell me how to delete my whole forum posting. I will attempt to create and post a new one. My apologies for being a dumbass nooby.

Thomas Kane / kmot

Don’t put yourself down. Deleting the topic just wastes your time and everyone else’s. Better to use the time trying Arduino programs. Like I said, start with simple examples, small steps modifying towards what you want. When it goes wrong, go back 1 step, think, ask.