smumpy
Posts: 12
Joined: Tue Oct 16, 2018 7:09 pm

piTFT 2.8" Resistive Display Tactile Button Halt Script

Sun Oct 21, 2018 1:32 am

My problem was programming the tactile buttons to work on a RPi Zero with a 2.8" Resistive display, however, i finally found a fix to this problem and made a full tutorial for anyone interested;

the tutorial is on how to set up a RPi Zero with a 2.8" Adafruit Resistive Touchscreen Display and PiCam to have a constant stream of the camera that started on boot as well as a proper poweroff/reboot sequence that is programmed to the tactile button(GPIO Pin) 27;

The full tutorial can be found;

viewtopic.php?f=43&t=225474
Last edited by smumpy on Sat Nov 03, 2018 1:22 pm, edited 4 times in total.

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: piTFT 2.8" Resistive Display Tactile Button Halt Script

Sun Oct 21, 2018 6:43 am

the below code is not formatted properly but you can easily see it in its correct state by following the above linked URL)
The only code that's relevant is *your* code because that's what is running on your Pi.
Indentation etc is important, and you should post all code (and preferrably also error messages) in code tags.
As it is now the code is almost impossible to read.

BTW: at least two of the links above do not work.

Looking at the error messages I would say that you copy / pasted from a website. There are tags in the code that should not be there:

Code: Select all

if (time.time() - startTime) > 2: 
Which is not anywhere near line 33 (as stated in the error msg) so you must have changed the code after you got the error msg. A definite nono as again it makes it much harder to debug.

Check the tutorial to get the correct code.
Last edited by DirkS on Sun Oct 21, 2018 1:52 pm, edited 1 time in total.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13102
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: piTFT 2.8" Resistive Display Tactile Button Halt Script

Sun Oct 21, 2018 12:44 pm

added code tags, but indentation was already lost.
please re-post, and use code tags.

Return to “Troubleshooting”