help with serial communication

i am having troubles with controlling an arduino from another arduino. i have an arduino pro mini with a button programmed to send a 'w' over serial com to my arduino uno. the uno has to servos with move forward when it reads the 'w'. the problem is when i hold in the button it sends mutiple 'w's and lags. but when controlling it with serial monitor it works fine.

i would like to know code which makes the the sender only send one 'w' when the button is held in?

the problem is when i hold in the button it sends mutiple 'w's and lags.

So, don't hold the switch. Or, look at the state change detection example, and send the 'w' only when the switch becomes (not is) pressed.

i would like to know code which makes the the sender only send one 'w' when the button is held in?

It would be your code.

thanks i used the change button state