I am going crazy with this issue - the installation of the 3.2 Waveshare is fine when running X11 and with
Code: Select all
TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event2 ts_calibrate
Here's the code:
Code: Select all
#!/usr/bin/python
import os
import sys
import time
import pygame
os.environ['SDL_VIDEODRIVER'] = 'Allwinner A10/A13 FBDEV'
os.environ["SDL_FBDEV"] = "/dev/fb1"
os.environ["SDL_MOUSEDRV"] = "TSLIB"
os.environ["SDL_MOUSEDEV"] = "/dev/input/event2"
pygame.init()
blue = (0,0,255)
black = (0,0,0)
white = (255,255,255)
gpos =(0,0)
bgimage = pygame.image.load('bg0003.jpg')
bgimage = pygame.transform.scale(bgimage, (320,240))
screen = pygame.display.set_mode((320,240))
screen.fill (black)
screen.blit(bgimage, (0,0))
myfont = pygame.font.SysFont("Computerfont",40)
prglabel = myfont.render('Test cheapo TFT', 1, white)
pygame.draw.rect(screen, blue, (0,0,480,40),)
screen.blit(prglabel, (40, 5))
pygame.display.update()
while True:
for event in pygame.event.get():
if event.type == 6:
cpos = pygame.mouse.get_pos()
if (cpos <> gpos):
print cpos
gpos = cpos
Code: Select all
(263, 0)
(179, 0)
(185, 0)
(319, 0)
(319, 239)
(319, 0)
(269, 28)
(34, 198)
(319, 121)
(242, 0)
(143, 239)
(319, 0)
(319, 23)
(319, 0)
(261, 0)
(319, 202)
(319, 239)
(319, 0)
(319, 148)
(265, 0)
(79, 92)
(247, 161)
(237, 239)