Arduino controlled LCD using a shift register and the SPI library

Now that I got my recycled 40x2 character LCD working with Arduino, the next step is to get it to show something useful.  I decided to add it to my Bluetooth Controlled robot  and display data from its two ultrasonic distance sensors (initially). Gradually  more interesting info like battery voltage and wheel encoder data can also be shown, as I get those components working. The problem is that now I need to find another 6 digital pins to control the LCD itself. Fortunately, there is an alternative: add a 74HC595 shift register and take advantage of the Arduino SPI library. Here is how: (more…)