6. Januar, 2018

Rotate Pimoroni Hyperpixel 90°

Von webfraggle

Display Rotation

First change display rotation in /boot/config.txt

display_rotate=1

Edit Hyperpixel touch driver

Then you need to edit the touch driver. Luckily it is a python script. I have the Information from here https://forums.pimoroni.com/t/hyper-pixel-rotate/5276/4. But the script has changed.

sudo nano /usr/bin/hyperpixel-touch

So here are my changes.

In the upper part Exchange 480 by 800 and viceversa:

(e.ABS_X, AbsInfo(value=0, min=0, max=480, fuzz=0, flat=0, resolution=1)),
        (e.ABS_Y, AbsInfo(value=0, min=0, max=800, fuzz=0, flat=0, resolution=1)),
        (e.ABS_MT_SLOT, AbsInfo(value=0, min=0, max=1, fuzz=0, flat=0, resolution=0)),
        (e.ABS_MT_TRACKING_ID, AbsInfo(value=0, min=0, max=65535, fuzz=0, flat=0, resolution=0)),
        (e.ABS_MT_POSITION_X, AbsInfo(value=0, min=0, max=480, fuzz=0, flat=0, resolution=0)),
        (e.ABS_MT_POSITION_Y, AbsInfo(value=0, min=0, max=800, fuzz=0, flat=0, resolution=0)),

and in the lower part Exchange x and y and add flipping the coordinates.

write_status(y1,800- x1, touch_one_start is not None, y2, 800-x2, touch_two_start is not None)

Restart hyperpixel touch daemon

sudo systemctl restart hyperpixel-touch