Serial buffering for Arduino RC Car

I want to know how to introduce a delay to my received serial data (like 5 seconds) before arduino executes the move commands for the RC car. Please note the control signals must be processed after 5 seconds :slight_smile: (pipelined,buffered), and does not mean that the processing occurs at 5 second intervals =( . I have an Arduino Uno Rev 3.

I want to know how to introduce a delay to my received serial data (like 5 seconds) before arduino executes the move commands for the RC car.

On each pass through loop(), see if there is serial data. If so, read it. If the data completes a packet, store the time the packet arrived, in one queue. Store the command itself in another queue.

On each pass through loop, see if it is time to execute the first command in the queue. If so, execute it, dequeuing it and the time. It will be time if now minus then (when the command arrived) is greater than the interval you want ("like 5 seconds").

Thank you PaulS, it worked brilliantly!