Go Down

Topic: Suggested enhancement for HardwareSerial (Read 420 times) previous topic - next topic

Mike Murdock

It would be very simple to add a new method to the HardwareSerial class.    The new method could be called 'txready' or something similar.  It would return true if the transmit data register is empty.

This way, a sketch could check to see if the UART is ready for another character before calling Serial.write().  The way it works now, a call to Serial.write() could wait while the last character shifts out.  With Serial.txready(), your sketch could be doing other things while a character is being transmitted.

-Mike

Coding Badly


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy