New curses (ncurses) is a programming library that allows developers to create text-based user interfaces. It is generally used for creating GUI-based applications or software. One of the key features of the ncurses library is that we can use it for taking inputs from keyboard keys, and controlling hardware devices on the output side. We will use the ncurses library to write programs to detect keys to control our robot accordingly. For example, if we press the up arrow, we want our robot to move forward. If we press the left arrow, we want our robot to take a left turn.
To install the ncurses library, we first have to open the command window. To install ncurses, type in the following command and press Enter:
sudo apt-get install libncurses5-dev libncursesw5-dev
Next, you will be asked whether you want to install the library. Type Y (for yes) and...