INPUT_PULLUP as its name implies pulls the input HIGH when the button is not pressed.
So if (digitalRead(2) == HIGH) will be true until you press the button. Try if (digitalRead(2) == LOW) instead
No. That is keeping the input pin at a known HIGH state when the button is not pressed which is what you want to avoid stray voltages affecting the input.
Changeif (digitalRead(2) == HIGH)toif (digitalRead(2) == LOW)
Note that I am assuming that one of the connections to the button is connected to Arduino pin 2 and the other one is connected to GND. Is that how it is wired ?
Ok , buttonbox works, but when you press repeats a few letters ex. BBBB ( one short push button ) , he dont make one letter , one push, if you can apply on delay ?
Stay away from using delay(). What you need to do is to send a letter when a button changes from not pressed to pressed rather than when the button is pressed as you are doing at present.
To do this you save the previous state of the button and if it has become pressed since the last time you checked you act on it. Look at the StateChangeDetection example in the IDE to see how to do it.
Another factor is that switch contacts bounce and do not open and close cleanly so can produce multiple on/off states even with what seems to be one button press. The IDE and the Web have examples of debouncing switches.