texy
Forum Moderator
Forum Moderator
Posts: 4991
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

2.8" TFT + Touch Shield Board v1 a/b/c

Wed Jul 03, 2013 7:25 pm

UPDATED 29/03/2015
Update - fbtft has now been included in the latest raspbian image and uses Device Tree - see this thread on how to configure the very latest raspbian os
http://www.raspberrypi.org/forums/viewt ... 5&t=105797
Note - select the HY28A overlay, not the HY28B

UPDATED 15/03/2014

The extremely talented notro has beening working hard to produce a raspbian based image that has the drivers built into the kernel.
This means that the console output goes to the TFT display much sooner into the boot sequence. Also he has created a ready-made image for you to download so that you do not need to go through the configuration procedure below ;)
The image can be downloaded from here :
http://tronnes.org/downloads/2014-06-20 ... -hy28a.zip
Notes and further setup details can be found here :
https://github.com/notro/fbtft-spindle/wiki/FBTFT-image
Slightly updated python test program (remember to run sudo ts_calibrate before running) :

Code: Select all

#!/usr/bin/python
# touchv7
# Texy 5/2/2014

import pygame, sys, os, time
from pygame.locals import *

#from evdev import InputDevice, list_devices
#devices = map(InputDevice, list_devices())
#eventX=""
#for dev in devices:
#    if dev.name == "ADS7846 Touchscreen":
#        eventX = dev.fn
#print eventX

#os.environ["SDL_FBDEV"] = "/dev/fb1"
#os.environ["SDL_MOUSEDRV"] = "TSLIB"
#os.environ["SDL_MOUSEDEV"] = eventX

pygame.init()

# set up the window
screen = pygame.display.set_mode((320, 240), 0, 32)
pygame.display.set_caption('Drawing')

# set up the colors
BLACK = (  0,   0,   0)
WHITE = (255, 255, 255)
RED   = (255,   0,   0)
GREEN = (  0, 255,   0)
BLUE  = (  0,   0, 255)
CYAN  = (  0, 255, 255)
MAGENTA=(255,   0, 255)
YELLOW =(255, 255,   0)
 
# Fill background
background = pygame.Surface(screen.get_size())
background = background.convert()
background.fill(WHITE)
box = pygame.draw.rect(background, YELLOW,(40, 0, 40, 240))
box = pygame.draw.rect(background,  CYAN, (80, 0, 40, 240))
box = pygame.draw.rect(background, GREEN, (120, 0, 40, 240))
box = pygame.draw.rect(background,MAGENTA,(160, 0, 40, 240))
box = pygame.draw.rect(background, RED,   (200, 0, 40, 240))
box = pygame.draw.rect(background, BLUE  ,(240, 0, 40, 240))
box = pygame.draw.rect(background, BLACK ,(280, 0, 40, 240))

# Display some text
font = pygame.font.Font(None, 36)
text = font.render("Touch here to quit", 1, (BLACK))
#text = pygame.transform.rotate(text,270) 
textpos = text.get_rect(centerx=background.get_width()/2,centery=background.get_height()/2)
background.blit(text, textpos)

screen.blit(background, (0, 0))
pygame.display.flip()

running = True
# run the game loop
while running:
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()
            running = False  
        elif event.type == pygame.MOUSEBUTTONDOWN:
            print("Pos: %sx%s\n" % pygame.mouse.get_pos())
            if textpos.collidepoint(pygame.mouse.get_pos()):
                pygame.quit()
                sys.exit()
                running = False
        elif event.type == KEYDOWN and event.key == K_ESCAPE:
            running = False
    pygame.display.update()

UPDATED 2/11/2013
Instructions for raspbmc are in this post :
http://www.raspberrypi.org/phpBB3/viewt ... 20#p447220


Placeholder for the 2.8" TFT Shield instructions, as described here :
http://www.raspberrypi.org/phpBB3/viewt ... 59&t=48956
and the updated 'v1b' and 'v1c' shields here :
http://www.raspberrypi.org/phpBB3/viewt ... 93&t=53144

Many thanks to Notro for the excellent fbtft drivers.



Screen and TP use hardware SPI ( SLCK, MOSI, MISO, CE0 & CE1 ) plus 3 additional GPIO lines ( GPIO17, GPIO18 & GPIO25 ), keeping the other GPIO lines free for other uses - the pcb has a 'breakout' GPIO port to connect too.

You no longer need to start off with notro's image - you can now start off with a standard raspbian image (or even raspbmc ;) )
However early versions of the raspbian image did cause some problems, so it is recommended to use version 2013-09-25 or later.

# Expand root filesystem

Code: Select all

sudo raspi-config
# Enable SPI

Code: Select all

sudo nano /etc/modprobe.d/raspi-blacklist.conf
and place a # in front of the SPI line

# Need to install the latest rpi-update like this, or else the REPO_URI variable gets overwritten

Code: Select all

sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
# Move or delete this directory, or else the new will be copied on top of the old and the kernel will complain about the leftover backlight.ko
# Issue: https://github.com/Hexxeh/rpi-update/issues/106

Code: Select all

sudo mv /lib/modules/$(uname -r) /lib/modules/$(uname -r).bak
# Install and restart the pi

Code: Select all

sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update
sudo shutdown -r now
Power down the pi, fit the display shield and repower the pi. Once rebooted 'modprobe' the modules to configure the screen :

Code: Select all


sudo modprobe fbtft dma
sudo modprobe fbtft_device name=hy28a rotate=270 speed=48000000 fps=50
At this point, the screen will go from white to black - the display has been successfully initialised.

Then to configure the touch panel

Code: Select all

sudo modprobe ads7846_device pressure_max=255 y_min=190 y_max=3850 gpio_pendown=17 x_max=3850 x_min=230 x_plate_ohms=100 swap_xy=1 verbose=3
Alternatively, to make the modules permanent after reboots, modify the /etc/module file :

Code: Select all

sudo nano /etc/modules
and add :

Code: Select all

fbtft dma
fbtft_device name=hy28a rotate=270 speed=48000000 fps=50
ads7846_device pressure_max=255 y_min=190 y_max=3850 gpio_pendown=17 x_max=3850 x_min=230 x_plate_ohms=100 swap_xy=1 verbose=3
After a reboot the display and touchscreen will be initialised. To check, type dmesg and the following lines should be included :

Code: Select all

[   20.102059] fbtft_device:  SPI devices registered:
[   20.108618] fbtft_device:      spidev spi0.0 500kHz 8 bits mode=0x00
[   20.118688] fbtft_device:      spidev spi0.1 500kHz 8 bits mode=0x00
[   20.126882] fbtft_device:  'fb' Platform devices registered:
[   20.135286] fbtft_device:      bcm2708_fb id=-1 pdata? no
[   20.142474] fbtft_device: Deleting spi0.0
[   20.152085] fbtft_device:  GPIOS used by 'hy28a':
[   20.158495] fbtft_device:    'reset' = GPIO25
[   20.181325] fbtft_device:    'led' = GPIO18
[   20.187179] fbtft_device:  SPI devices registered:
[   20.194042] fbtft_device:      spidev spi0.1 500kHz 8 bits mode=0x00
[   20.202089] fbtft_device:      fb_ili9320 spi0.0 32000kHz 8 bits mode=0x03
[   20.342275]
[   20.342275]
[   20.342275] ads7846_device: ads7846_device_init()
[   20.368505] ads7846_device: SPI devices registered:
[   20.381172] ads7846_device:    spidev spi0.1 500kHz 8 bits mode=0x00
[   20.389113] ads7846_device:    fb_ili9320 spi0.0 32000kHz 8 bits mode=0x03
[   20.421072] ads7846_device:
[   20.425419] ads7846_device: Settings:
[   20.430480] ads7846_device:   model = 7846
[   20.451105] ads7846_device:   gpio_pendown = 17
[   20.457011] ads7846_device:   swap_xy = 1
[   20.471058] ads7846_device:   x_min = 230
[   20.476404] ads7846_device:   x_max = 3850
[   20.491059] ads7846_device:   y_min = 190
[   20.496320] ads7846_device:   y_max = 3850
[   20.511054] ads7846_device:   x_plate_ohms = 100
[   20.516888] ads7846_device:   pressure_min = 0
[   20.541052] ads7846_device:   pressure_max = 255
[   20.546842] ads7846_device:   keep_vref_on = 1
[   20.561050] ads7846_device:   vref_delay_usecs = 0
[   20.567017] ads7846_device:   vref_mv = 0
[   20.581061] ads7846_device:   settle_delay_usecs = 0
[   20.587191] ads7846_device:   penirq_recheck_delay_usecs = 0
[   20.611048] ads7846_device:   y_plate_ohms = 0
[   20.616607] ads7846_device:   debounce_max = 0
[   20.631051] ads7846_device:   debounce_tol = 0
[   20.636555] ads7846_device:   debounce_rep = 0
[   20.651107] ads7846_device: Deleting spi0.1
[   20.661387] ads7846_device: SPI devices registered:
[   20.667362] ads7846_device:    fb_ili9320 spi0.0 32000kHz 8 bits mode=0x03
[   20.691094] ads7846_device:    ads7846 spi0.1 2000kHz 8 bits mode=0x00
[   20.698795] ads7846_device:
[   21.649752] graphics fb1: fb_ili9320 frame buffer, 320x240, 150 KiB video memory, 4 KiB buffer memory, fps=20, spi0.0 at 32 MHz
[   21.725057] ads7846 spi0.1: touchscreen, irq 187
[   21.752372] input: ADS7846 Touchscreen as /devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/input/input0
In order to use the touch panel with python, X, and to calibrate it, a few packages need loading :

Code: Select all

sudo apt-get update
sudo apt-get install libts-bin evtest xinput python-dev python-pip
Then use pip to install evdev :

Code: Select all

sudo pip install evdev
To calibrate the touch panel :

Code: Select all

sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate
Use a stylus (or a pencil!) to select each point in turn. This will be the first time you see anything on the screen too ;)
Note that if you have other input devices, ie keyboard and/or mouse, /dev/input/event0 may be, for example /dev/input/event1 or /dev/input/event2 or /dev/input/event3, etc.

Here is a test python program than uses pygame :

Code: Select all

#!/usr/bin/python
# touchv5
# Texy 1/6/13

import pygame, sys, os, time
from pygame.locals import *

from evdev import InputDevice, list_devices
devices = map(InputDevice, list_devices())
eventX=""
for dev in devices:
    if dev.name == "ADS7846 Touchscreen":
        eventX = dev.fn
print eventX

os.environ["SDL_FBDEV"] = "/dev/fb1"
os.environ["SDL_MOUSEDRV"] = "TSLIB"
os.environ["SDL_MOUSEDEV"] = eventX

pygame.init()

# set up the window
screen = pygame.display.set_mode((320, 240), 0, 32)
pygame.display.set_caption('Drawing')

# set up the colors
BLACK = (  0,   0,   0)
WHITE = (255, 255, 255)
RED   = (255,   0,   0)
GREEN = (  0, 255,   0)
BLUE  = (  0,   0, 255)
CYAN  = (  0, 255, 255)
MAGENTA=(255,   0, 255)
YELLOW =(255, 255,   0)
 
# Fill background
background = pygame.Surface(screen.get_size())
background = background.convert()
background.fill(WHITE)
box = pygame.draw.rect(background, YELLOW,(0, 0, 40, 240))
box = pygame.draw.rect(background,  CYAN, (40, 0, 40, 240))
box = pygame.draw.rect(background, GREEN, (80, 0, 40, 240))
box = pygame.draw.rect(background,MAGENTA,(120, 0, 40, 240))
box = pygame.draw.rect(background, RED,   (160, 0, 40, 240))
box = pygame.draw.rect(background, BLUE  ,(200, 0, 40, 240))
box = pygame.draw.rect(background, BLACK ,(240, 0, 40, 240))

# Display some text
font = pygame.font.Font(None, 36)
text = font.render("Touch here", 1, (BLACK))
#text = pygame.transform.rotate(text,270) 
textpos = text.get_rect(centerx=background.get_width()/2,centery=background.get_height()/2)
background.blit(text, textpos)

screen.blit(background, (0, 0))
pygame.display.flip()

running = True
# run the game loop
while running:
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()
            running = False  
        elif event.type == pygame.MOUSEBUTTONDOWN:
            print("Pos: %sx%s\n" % pygame.mouse.get_pos())
            if textpos.collidepoint(pygame.mouse.get_pos()):
                pygame.quit()
                sys.exit()
                running = False
        elif event.type == KEYDOWN and event.key == K_ESCAPE:
            running = False
    pygame.display.update()

Image

With this configuration, the screen has been rotated for landscape use. In order to use the touch panel with X, the touch panel input also needs rotating.
Do this by

Code: Select all

sudo nano /etc/X11/xinit/xinitrc
and add this line before ". /etc/X11/Xsession" :

Code: Select all

DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 0 1
Then to run X use

Code: Select all

FRAMEBUFFER=/dev/fb1 startx -- -dpi 60

Some people have seem issues with the touch panel having y-axis inverted in X11. If you see this problem you'll need to modify usr/share/X11/xorg.conf.d/10-evdev.conf :

Code: Select all

sudo nano /usr/share/X11/xorg.conf.d/10-evdev.conf
You need to modify the Section "InputClass" to be like this :

Code: Select all

Section "InputClass"
        Identifier "evdev touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
        Option "InvertY" "true"
EndSection
Save the file and relaunch X11. Thanks to NeillyThere for this fix ;)

Finally, to allow the console to be shown on the display from boot-up modify /boot/cmdline.txt :

Code: Select all

sudo nano /boot/cmdline.txt
and add the following TO THE END OF THE LINE :

Code: Select all

 fbcon=map:10 fbcon=font:VGA8x8
so all of the options are one 1 single line.

Note all of the instructions in this post assume you wish to use the display/touch panel in landscape mode, with the hdmi connector at the top as you look at the pi/shield.
Of course, there are 3 other orientations possible, so notro's github page for further information - https://github.com/notro/fbtft/wiki

Much more information and discussion can be found in this thread : http://www.raspberrypi.org/phpBB3/viewt ... 64&t=34007
Many thanks again to Notro for the drivers, and also Andybiker for the inspiration ;)



NOTE THAT APT-GET UPGRADE WILL BREAK THE DRIVERS - SO USE THE FOLLOWING PROCEDURE TO UPDATE THE SYSTEM :

Code: Select all

sudo apt-mark hold raspberrypi-bootloader
sudo apt-get update
sudo apt-get upgrade
And rpi-update also overwrites the custom kernel, so use :

Code: Select all

sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update
[/b][/color]


Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

texy
Forum Moderator
Forum Moderator
Posts: 4991
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board

Sun Jul 07, 2013 8:20 am

For those of you who have bought a kit from me, here is the construction guide :
You will need :
The kit :
Image
A soldering iron with fine tip
Solder
Side-cutters
Mini-clamp
Raspberry Pi
ESD friendly work surface

1..Place the 26-way connector on the Pi :
Image
2..With the Pi's HDMI connector pointing away from you and the GPIO port on the bottom right, place the pcb on the connector with the 2 supplied pads between it and the USB connector and clamp together :
Image
Make sure the pcb is level and parallel with the Pi. There should be approximately a 3mm gap between the top of the connector and the underside of the pcb :
Image
3..Solder the pcb to the connector, then cut away the excess pin length with the side-cutters. Make sure there is no solder bridges between the pins.
4..Remove the pcb from the Pi
5..Place the display onto the pcb, with the UP arrows pointing up and the GPIO connector on the bottom right :
Image
6..Solder the display to the pcb, again ensuring there are no solder shorts. Cut away the excess pin length, keeping as short as possible.
7..Remove the paper from one side of the gap pad and place here along one row of pins :
Image

Construction complete !
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
bob_binz
Posts: 373
Joined: Thu Feb 02, 2012 7:58 pm
Location: Stockport, UK

Re: 2.8" TFT + Touch Shield Board

Sun Jul 07, 2013 10:36 am

This looks great Texy.

Out of curiosity, who manufactures your PCBs?

texy
Forum Moderator
Forum Moderator
Posts: 4991
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board

Sun Jul 07, 2013 10:42 am

bob_binz wrote:This looks great Texy.

Out of curiosity, who manufactures your PCBs?
Hi Bob,
Itead Studios -
http://imall.iteadstudio.com/open-pcb/p ... yping.html
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

texy
Forum Moderator
Forum Moderator
Posts: 4991
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board

Sun Jul 07, 2013 10:42 am

Now uploaded a video :
http://www.youtube.com/watch?v=7CQt9nlTBEE

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

chrismog
Posts: 1
Joined: Sun Jul 07, 2013 9:35 am

Re: 2.8" TFT + Touch Shield Board

Sun Jul 07, 2013 12:20 pm

Wow...this is just what I've been looking for...brilliant!

dan3008
Posts: 1169
Joined: Wed Aug 15, 2012 1:05 pm

Re: 2.8" TFT + Touch Shield Board

Sun Jul 07, 2013 9:06 pm

I'm assuming this is treated like a mouse with a left click for tap?

Thanks
dan3008 wrote:Pays your money, takes your choice

User avatar
LetHopeItsSnowing
Posts: 350
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: 2.8" TFT + Touch Shield Board

Mon Jul 08, 2013 5:41 am

Hi Texy,

Are there instructions for installing the drivers onto a standard raspbian image? I've got an image which i would prefer to update rather than reflash my card.

Thanks

Mart
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

texy
Forum Moderator
Forum Moderator
Posts: 4991
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board

Mon Jul 08, 2013 6:37 am

LetHopeItsSnowing wrote:Hi Texy,

Are there instructions for installing the drivers onto a standard raspbian image? I've got an image which i would prefer to update rather than reflash my card.

Thanks

Mart
Hi Mart,
yes, little a little more than just installing drivers as fbtft uses a custom kernel, see instructions here :
https://github.com/notro/fbtft/wiki/Bui ... ft-drivers

As always, I would recommend making a backup before trying it.

Regards,
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

texy
Forum Moderator
Forum Moderator
Posts: 4991
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board

Mon Jul 08, 2013 6:40 am

Also, as a general note/warning - using apt-get upgrade will break the fbtft drivers, so a work around is required :

Code: Select all

sudo apt-mark hold raspberrypi-bootloader
sudo apt-get update
sudo apt-get upgrade
And rpi-update also overwrites the custom kernel, so use :

Code: Select all

sudo apt-get install rpi-update
sudo SKIP_KERNEL=1 rpi-update
Further information available here :
https://github.com/notro/fbtft/issues/10

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

texy
Forum Moderator
Forum Moderator
Posts: 4991
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board

Tue Jul 09, 2013 8:45 pm

Although not heavily tested, an increase in speed to 22fps has found to be achievable. To test, use the following:

Firstly unload the existing module :

Code: Select all

sudo rmmod fbtft_device
The reload with the new configuration :

Code: Select all

sudo modprobe fbtft_device name=hy28afb rotate=1 speed=48000000
sudo modprobe hy28afb debug=32
The debug=32 part will add extra information to system message log. After running your application type

Code: Select all

dmesg
it will return information regarding the performance of the driver :

Code: Select all

[  243.530392] hy28afb spi0.0: Elapsed time for display update:   43.447004 ms (fps: 23, lines=240)
[  243.620599] hy28afb spi0.0: Elapsed time for display update:   43.622004 ms (fps: 22, lines=240)
[  243.712621] hy28afb spi0.0: Elapsed time for display update:   45.587004 ms (fps: 21, lines=240)
[  243.800336] hy28afb spi0.0: Elapsed time for display update:   43.380004 ms (fps: 23, lines=240)
[  243.890653] hy28afb spi0.0: Elapsed time for display update:   43.721004 ms (fps: 22, lines=240)
Can you try this and report back for the benefit of other users please.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

dan3008
Posts: 1169
Joined: Wed Aug 15, 2012 1:05 pm

Re: 2.8" TFT + Touch Shield Board

Tue Jul 09, 2013 9:17 pm

22 fps? thats way faster than i was expecting. I expected nearer 10 :D

cant wait to get my hands one one now :) ... Time to work on my LCARS system i thinks lol
dan3008 wrote:Pays your money, takes your choice

aldomontoya
Posts: 11
Joined: Tue Jun 04, 2013 11:46 am

Re: 2.8" TFT + Touch Shield Board

Wed Jul 10, 2013 7:35 am

Hi, thanks for the module. I can get the callibration app to run fine, but when i run the test app, it does not show on the tft (but does on the "normal" monitor.

So i tried running X on the tft and that works as far as display goes, but does not respond to touch (again, the callibration did), any ideas?

Thanks!

texy
Forum Moderator
Forum Moderator
Posts: 4991
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board

Wed Jul 10, 2013 10:22 am

Hi,
notro has just released a new image, so I downloaded that last night, and went through my instructions (by cutting and pasting, so that I know the instruction had no typo's) in the first post of this thread and I had no issues. Note that the calibration is included in the instructions, but not the test. However I have run the test before and it also worked OK. I will give it another go tonight.
Just to confirm,. you are saying that

Code: Select all

sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event3 ts_calibrate
works OK, but

Code: Select all

sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event3 ts_test
does not work?
One thing to check is if you have mouse and/or keyboard connected - this will determine which eventX is used. If you run the python test program I posted, it will tell you which eventX is being used by the touch panel - you must make sure eventX matches that, ie with no mouse or keyboard conencted in my systen eventX is 0, ie event0.
HTH,
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

aldomontoya
Posts: 11
Joined: Tue Jun 04, 2013 11:46 am

Re: 2.8" TFT + Touch Shield Board

Wed Jul 10, 2013 10:56 am

Hi Texy, thanks for the reply.

Yes you are correct, the callibration works, but not the test as you state.

Let me redo the image and try again, maybe i upgraded a module incorrectly somewhere...

Brilliant project though, going to have fun with this one.

Al

texy
Forum Moderator
Forum Moderator
Posts: 4991
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board

Wed Jul 10, 2013 11:02 am

Try this first

Code: Select all

sudo apt-get update
sudo apt-get install libts-bin
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

aldomontoya
Posts: 11
Joined: Tue Jun 04, 2013 11:46 am

Re: 2.8" TFT + Touch Shield Board

Wed Jul 10, 2013 11:33 am

This gets a bit more interesting! ts_calibrate and ts_test both work, but the python script still displays on my usual monitor (and if i mouse-click in the window the co-ordinates are printed), but nothing on the tft.

At the start of the script it shows the correct event id (in this case event3, which i use for the two ts_x tests).

texy
Forum Moderator
Forum Moderator
Posts: 4991
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board

Wed Jul 10, 2013 11:46 am

Strange - I use ssh most of the time - are you, or are you local?
How are you running the python test.py program? (or whatever you've called it).
The other thing is that perhaps having a hdmi monitor/tv connected at the same time is confusing the pi......
T.
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

aldomontoya
Posts: 11
Joined: Tue Jun 04, 2013 11:46 am

Re: 2.8" TFT + Touch Shield Board

Wed Jul 10, 2013 11:57 am

No, I am working locally. Will try that out tonight at home, at work cannot remote in due to a very restrictive corporate network! Will let you know how i get on, thanks for the help.

aldomontoya
Posts: 11
Joined: Tue Jun 04, 2013 11:46 am

Re: 2.8" TFT + Touch Shield Board

Wed Jul 10, 2013 11:59 am

Sorry, forgot to add, i am running the script from a terminal.

texy
Forum Moderator
Forum Moderator
Posts: 4991
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board

Wed Jul 10, 2013 12:31 pm

When I said locally, I meant using a keyboard and monitor connected directly to the pi, as opposed to ssh'ing into the pi using another pc over the network - just to be clear, I probably didn't make it so, lol :?

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

aldomontoya
Posts: 11
Joined: Tue Jun 04, 2013 11:46 am

Re: 2.8" TFT + Touch Shield Board

Wed Jul 10, 2013 12:39 pm

No worries, got it! Although I am in Hampshire, not too far from Berkshire!

texy
Forum Moderator
Forum Moderator
Posts: 4991
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board

Wed Jul 10, 2013 12:54 pm

I am in Hampshire as I type this lol
T.
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
meltwater
Posts: 1014
Joined: Tue Oct 18, 2011 11:38 am

Re: 2.8" TFT + Touch Shield Board

Thu Jul 11, 2013 9:57 pm

Hey. Just to let you know, received, built and got the screen running tonight. Works a treat!

I just need to modify my case now, so it is less exposed when travelling.

Are there any pre-built kernels for the current raspibian release, I would love to use it with my main install, but the prospect of an 8 hour compile isn't too appealing (long time to wait only to find something didn't work). Anyway, many thanks!
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam

texy
Forum Moderator
Forum Moderator
Posts: 4991
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: 2.8" TFT + Touch Shield Board

Fri Jul 12, 2013 4:38 am

Hi,
Notro's download as linked in the first post of this thread is based on the latest wheezy image and is only a few days old.
Or am I misunderstanding your question?
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Return to “Add-ons”

Who is online

Users browsing this forum: No registered users and 5 guests