[URGENT] Measuring time interval for serial communication

Sorry i've fallen sick for the past few days. didnt manage to generate the coding yet,

3) something prompt by the python coding which requires arduino to react by sending something back to python 4 ) python calculates the time taken for this

I have made it known several times that I like to see a separation between coding skills and "dreams". In many discussions the dreamers take over with their - why are you doing this, what it suppose to do.

I feel this one of those poorly defined dreams and since my code finally works I have time to vent.

So you will send "something" between snake and topolino . The signal path is undetermined, but signal propagation in ANY media is well known and MUCH faster than snake getting after topolino. On the other hand serial communication speed ( baud rate) using common standards is pretty much govern by UART and associated hardware.

This definitely is "dream" in my book whose "specification" and hardware constrains won't tell much about speed of communication..

Don't get me wrong - it is definitely doable and will be fun, but WHY?

BTW ever heard about "local / remote loopback?"

If that is too simple task for you - how writing error correcting software to guarantee set error rate?

Have fun with your project. Jim

@julyjim, you are the second person to make that point in this Thread.

As I said earlier I can see nothing inappropriate (or dream like) about wanting to know how long a round-trip message takes for a particular combination of Python and Arduino code.

If the object of the exercise was to write a successful PhD thesis the various issues that have been mentioned would certainly need to be discussed.

…R

i have these two codes for my arduino now.

however i dont have the correct code for my python.

somehow i couldnt even write a correct one

I'm have 0 knowledge to both python and arduino.

unsigned long incomingByte = millis();

void setup() {

Serial.begin(9600); }

void loop() { if (Serial.available() > 0) { incomingByte = Serial.read(); Serial.print("Let me see your brain"); Serial.println(incomingByte); Serial.write("Im gonna love you inside out"); } }

void setup() { Serial.begin(9600); unsigned long timeStart = micros();

Serial.println(F("Lets guess")); Serial.println(F("In the name of love")); Serial.println(F("done"));

unsigned long timeStop = millis(); Serial.print(F("It takes: ")); Serial.print( timeStop - timeStart); Serial.println(F(" microseconds.")); }

void loop() {}

julyjim: In many discussions the dreamers take over with their - why are you doing this, what it suppose to do. ... Don't get me wrong - it is definitely doable and will be fun, but WHY?

The "why" is no business of yours, is it Vaclav julyjim? To get an indication of latency in USB serial handling? What does it matter? It's URGENT - can't you read?

trxy: I'm have 0 knowledge to both python and arduino.

so care to explain why it's urgent, why you attempt to do this even if the answer is "it's just intellectually fun" because we often see people asking X while they are attempting to do Y because they believe X is what they need (and they never tell us about Y and Y is the true pb to solve).

Also if you have zero knowledge of both environment, why don't you start at square one and learn... there are tons of good on line resources for both.

trxy: i have these two codes for my arduino now.

however i dont have the correct code for my python.

somehow i couldnt even write a correct one

I gave you a link to working Python and Arduino code in Reply #3

Was I wasting my time?

...R

Was I wasting my time?

Is that a trick question?