I use mpu6050 sensor for reading angle and send to serial port ; and now i need to read data from this sensor and send data to my step motor with serial port in same time , when i put
" float ss = Serial.parseFloat(); " and " stepper.step(ss*1823.94); " in void loop that send sensor data a unwanted delay occur .
The idea is to read a character at a time in loop() and add it to a buffer, do something else in loop() like controlling the stepper or blinking the led. Continue doing that till you have the full message and can parse it.
In the program I have for controlling a small lathe the PC sends instructions that are less than 64 bytes long so they fit in the Serial Input buffer. While the Arduino is executing the previous instruction a new instruction will arrive in the input buffer. When the move is complete the data for the next move is ready waiting to be read and acted upon.
In terms of the examples in Serial Input Basics the call to recvWithStartEndMarkers() is made when the current move is complete.
I don't know why you are using float variables at all because stepper motors work in integer numbers of steps. Calculations on the Arduino using float variables are very slow. Do that sort of thing on the PC and simplify the work of the Arduino.