Problem in key press or hold for control DC motor

I control motor with keyboard I have two function ,for short key press ,if one press key write until 20second ,and function long key press write until key hold ,these two function work singly , and now according to this link I want these work together Single, double and hold button - Syntax & Programs - Arduino Forum
and Recognize if key short press do write until 20 second, if hold key do write until key down; why my program doesn't work??
I use function reset terminal and dataRdy to non-blocking I/O of getch();

That does not look like regular Arduino IDE code. Does it need to be so complex?

...R

I wrote for raspberry

girl71:
I wrote for raspberry

This is the Arduino Forum :slight_smile:

...R