![]() My previous pygame script (see above) worked perfectly after the coordinates were scaled to fit the new screen.Īnother is that although the display doesn’t use the GPIO header, it mounts on the Raspberry PI using PCB spacers. One nice thing about this option is that it simply works as an X display out of the box. I found the latter option more convenient. Power can be taken from the GPIO, or the USB cable using a USB splitter. However, it connects directly to the DSI cable found on the PI 2 & 3. This is a much larger screen, intended for small tablet sized applications. Instead, I used the Pimoroni 7″ touchscreen display. Unfortunately I never found out, because I burnt the screen out when connecting up the required ribbon cables. In theory, it should work with the OpenSprinkler because they use different GPIO pins. The Adafruit screen is a nice little screen that is the ideal size for this project. The trick here appears to be the use of both sudo and the full path to the python executable. Where /home/pi/sprinkle/xmanual.py is the script that you would like to run. Add the following line: /usr/bin/python /home/pi/sprinkle/xmanual.py This is solved by editing ~/.config/lxsession/LXDE-pi/autostart. The only slight oddity is that the touchscreen is technically showing a HDMI copy, and this will have the minimum coordinates of 640x480px – double the touchscreen’s actual resolution.Īnother issue which a lot of people appear to have had trouble with, is how to get the script to run at startup with X. Here is the pygame setup code: pygame.init() X will then interpret the touch events as mouse events which pygame can then interpret correctly. This took some figuring out, but the solution is to configure the display to use X, and then tell pygame to run in “full screen mode” with the mouse displayed. This displays well in framebuffer mode, but the touch does not work. I needed a simple graphical user interface, and a typical X desktop is far too small for a 2.8″ touchscreen, so I wrote a full screen menu system with pygame. I tried a ‘jessie’ image, but this will not boot on the Raspi 3B+! ![]() A lot of people had problems with ‘wheezy’ and they had to move back to ‘jessie’. The command line and X configuration options appear to work okay, but the framebuffer touch option does not. Unfortunately the drivers are for the older ‘wheezy’ and ‘jessie’ versions of Rasbian and not the latest ‘Stretch’. This is a neat little screen that works as a ‘hat’ that plugs straight on to the Raspberry PI. I’ve chosen to use the Adafruit 2.8″ TFT Capacitive Touch LCD screen. This is for my own convenience, but I also don’t want to go through the hassle of telling a contractor how to log in to the local wifi and to go to an obscure URL to test a valve or station! I will post a much more complete post when it is working, but here are a couple of useful tips that I’ve found.Īlthough it will be programmed using a web interface over Wifi, I need the local ability to manually switch stations on or off for testing. I am currently putting together a lawn sprinkler control system based around a Raspberry PI 3 Model B+ and the OpenSprinkler system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |