I’ve been working on getting a standard $12 16×2 LCD hooked up to my OSPI rev 1.43. I’ve managed to get OSPI running on the Pi Zero W and got the LCD hooked up using pins that don’t conflict with OSPI.
I next started trying to figure out how to use the display. I originally just wanted to show the IP address but in looking at the code, it looks like it’s already set up for an LCD display assuming that it’s hooked up correctly.
My question is, is there any documentaiton for how to hook up an LCD screen with the Pi so that it automatically detects and uses it without having to modify the source code?
I don’t think there is a direct way to automatically detect the LCD — unless if you use an I2C type LCD (in which case checking the existence of the I2C address will allow it to automatically detect LCD). Most of the code for LCD is already in the firmware code, it’s just that they are only enabled for the microcontroller-based OpenSprinkler. The OSPi branch disables all LCD functions. You can do some copy pasting to basically replicate the LCD functions to the OSPi branch.
To reduce the number of wiring, I do highly recommend you to use the I2C type of 16×2 LCD (just search ‘I2C 1602 LCD’). It only has 4 wires so is a lot easier to hook up to RPi.
Yes, look at RPi’s default I2C pins (SDA and SCL), and you can hook up your LCD to those pins. On the firmware side, we haven’t added code to the OSPi section to support I2C but it should be fairly easy to add these. The OpenSprinkler section already supports I2C LCD, so it’s just a matter of adapting those code to OSPi.