Skip to main content
Arduino

Return to Question

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I've also asked this question over on stack exchange so I'll link the actual question here here.

The short story is I have a plot that updates in real time from data collected on an Arduino. The plot updates on a 50ms + overhead interval and I can either choose on the Arduino side to either delay the loop 50ms + compensation or use flush(). I'm running into some problems with the delay option where my program begins to lag (Python side). I'm wondering if flush will work as I expect and hold the output until my python program reads from the serial port. So then the Python program is completely controlling the flow of data every time it polls for an update.

Edit: Here's a snippet of the code.

void loop() {
 // put your main code here, to run repeatedly:
 val1 = analogRead(0);
 val2 = analogRead(1);
 Serial.print(val1);
 Serial.print(" ");
 Serial.print(val2);
 Serial.print("\n");
 //Serial.flush();
 delay(50); 
}

I've also asked this question over on stack exchange so I'll link the actual question here.

The short story is I have a plot that updates in real time from data collected on an Arduino. The plot updates on a 50ms + overhead interval and I can either choose on the Arduino side to either delay the loop 50ms + compensation or use flush(). I'm running into some problems with the delay option where my program begins to lag (Python side). I'm wondering if flush will work as I expect and hold the output until my python program reads from the serial port. So then the Python program is completely controlling the flow of data every time it polls for an update.

Edit: Here's a snippet of the code.

void loop() {
 // put your main code here, to run repeatedly:
 val1 = analogRead(0);
 val2 = analogRead(1);
 Serial.print(val1);
 Serial.print(" ");
 Serial.print(val2);
 Serial.print("\n");
 //Serial.flush();
 delay(50); 
}

I've also asked this question over on stack exchange so I'll link the actual question here.

The short story is I have a plot that updates in real time from data collected on an Arduino. The plot updates on a 50ms + overhead interval and I can either choose on the Arduino side to either delay the loop 50ms + compensation or use flush(). I'm running into some problems with the delay option where my program begins to lag (Python side). I'm wondering if flush will work as I expect and hold the output until my python program reads from the serial port. So then the Python program is completely controlling the flow of data every time it polls for an update.

Edit: Here's a snippet of the code.

void loop() {
 // put your main code here, to run repeatedly:
 val1 = analogRead(0);
 val2 = analogRead(1);
 Serial.print(val1);
 Serial.print(" ");
 Serial.print(val2);
 Serial.print("\n");
 //Serial.flush();
 delay(50); 
}

I've also asked this question over on stack exchange so I'll link the actuallyactual question Herehere .

The short story is I have a plot that updates in real time from data collected on an arduinoArduino. The plot updates on a 50ms + overhead interval and I can either choose on the arduinoArduino side to either delay the loop 50ms + compensation or use flush()flush(). I'm running into some problems with the delay option where my program begins to lag (pythonPython side). I'm wondering if flush will work as I expect and hold the output until my python program reads from the serial port. So then the pythonPython program is completely controlling the flow of data every time it polls for an update.

Edit: Here's a snippitsnippet of the code.

void loop() {
 // put your main code here, to run repeatedly:
 val1 = analogRead(0);
 val2 = analogRead(1);
 Serial.print(val1);
 Serial.print(" ");
 Serial.print(val2);
 Serial.print("\n");
 //Serial.flush();
 delay(50); 
}

Thanks in advance!

I've also asked this question over on stack exchange so I'll link the actually question Here

The short story is I have a plot that updates in real time from data collected on an arduino. The plot updates on a 50ms + overhead interval and I can either choose on the arduino side to either delay the loop 50ms + compensation or use flush(). I'm running into some problems with the delay option where my program begins to lag (python side). I'm wondering if flush will work as I expect and hold the output until my python program reads from the serial port. So then the python program is completely controlling the flow of data every time it polls for an update.

Edit: Here's a snippit of the code.

void loop() {
 // put your main code here, to run repeatedly:
 val1 = analogRead(0);
 val2 = analogRead(1);
 Serial.print(val1);
 Serial.print(" ");
 Serial.print(val2);
 Serial.print("\n");
 //Serial.flush();
 delay(50); 
}

Thanks in advance!

I've also asked this question over on stack exchange so I'll link the actual question here .

The short story is I have a plot that updates in real time from data collected on an Arduino. The plot updates on a 50ms + overhead interval and I can either choose on the Arduino side to either delay the loop 50ms + compensation or use flush(). I'm running into some problems with the delay option where my program begins to lag (Python side). I'm wondering if flush will work as I expect and hold the output until my python program reads from the serial port. So then the Python program is completely controlling the flow of data every time it polls for an update.

Edit: Here's a snippet of the code.

void loop() {
 // put your main code here, to run repeatedly:
 val1 = analogRead(0);
 val2 = analogRead(1);
 Serial.print(val1);
 Serial.print(" ");
 Serial.print(val2);
 Serial.print("\n");
 //Serial.flush();
 delay(50); 
}
added 331 characters in body
Source Link

I've also asked this question over on stack exchange so I'll link the actually question Here

The short story is I have a plot that updates in real time from data collected on an arduino. The plot updates on a 50ms + overhead interval and I can either choose on the arduino side to either delay the loop 50ms + compensation or use flush(). I'm running into some problems with the delay option where my program begins to lag (python side). I'm wondering if flush will work as I expect and hold the output until my python program reads from the serial port. So then the python program is completely controlling the flow of data every time it polls for an update.

Edit: Here's a snippit of the code.

void loop() {
 // put your main code here, to run repeatedly:
 val1 = analogRead(0);
 val2 = analogRead(1);
 Serial.print(val1);
 Serial.print(" ");
 Serial.print(val2);
 Serial.print("\n");
 //Serial.flush();
 delay(50); 
}

Thanks in advance!

I've also asked this question over on stack exchange so I'll link the actually question Here

The short story is I have a plot that updates in real time from data collected on an arduino. The plot updates on a 50ms + overhead interval and I can either choose on the arduino side to either delay the loop 50ms + compensation or use flush(). I'm running into some problems with the delay option where my program begins to lag (python side). I'm wondering if flush will work as I expect and hold the output until my python program reads from the serial port. So then the python program is completely controlling the flow of data every time it polls for an update.

Thanks in advance!

I've also asked this question over on stack exchange so I'll link the actually question Here

The short story is I have a plot that updates in real time from data collected on an arduino. The plot updates on a 50ms + overhead interval and I can either choose on the arduino side to either delay the loop 50ms + compensation or use flush(). I'm running into some problems with the delay option where my program begins to lag (python side). I'm wondering if flush will work as I expect and hold the output until my python program reads from the serial port. So then the python program is completely controlling the flow of data every time it polls for an update.

Edit: Here's a snippit of the code.

void loop() {
 // put your main code here, to run repeatedly:
 val1 = analogRead(0);
 val2 = analogRead(1);
 Serial.print(val1);
 Serial.print(" ");
 Serial.print(val2);
 Serial.print("\n");
 //Serial.flush();
 delay(50); 
}

Thanks in advance!

Source Link
Loading
lang-cpp

AltStyle によって変換されたページ (->オリジナル) /