Displaying user input on the display
In this section, we are going to print the input of a user onto the display. The input is being sent from the computer to the microcontroller using serial (UART), which will then print it onto the display.
In Chapter 2, Building a Traffic Lights Control System, we learned how to use UART to send messages to the computer, and observed them using PuTTY. Now, we are going to use this interface bidirectionally. For this project, we are using the same hardware setup that we used in the previous section, which means we can directly dive into the code.
Start by creating a new folder named hd44780-user-input
inside the Chapter06
folder. Then, inside this newly created folder, add a new main.go
file with an empty main()
function inside it. The project's structure should now look similar to the following:
Follow these steps to implement the program:
- Save the hex value for...