Thank you for the reply!The documentation is quite clear....
https://cec-code-lab.aps.edu/robotics/r ... 566bc868e8
int getchar_timeout_us ( uint32_t timeout_us)
Return a character from stdin if there is one available within a timeout.
Parameters
timeout_usthe timeout in microseconds, or 0 to not wait for a character if none available.
Returns
the character from 0-255 or PICO_ERROR_TIMEOUT if timeout occurs
PeterO
But I still don't understand how, I do press a key (like 'd', or 'p') then this function will be called, how can it return -1 for none available?
This function is called every time when I press a key, so how can I catch the key been pressed by this function?
Statistics: Posted by crisps — Fri Feb 23, 2024 1:34 pm