# Hyperpixel Touch Rotate Screen - current status?

**URL:** https://forums.pimoroni.com/t/hyperpixel-touch-rotate-screen-current-status/9075
**Category:** Support
**Created:** [November 5, 2018, 11:06pm UTC](https://forums.pimoroni.com/t/hyperpixel-touch-rotate-screen-current-status/9075 "2018-11-05T23:06:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![splitbrain](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/splitbrain/32/4777_2.png) [@splitbrain](https://forums.pimoroni.com/u/splitbrain)
#### Post date: [November 5, 2018, 11:06pm UTC](https://forums.pimoroni.com/t/hyperpixel-touch-rotate-screen-current-status/9075/1 "2018-11-05T23:06:19Z")

</div>

I’ve read through [Hyperpixel 4.0 Touchscreen Rotate with Display](https://forums.pimoroni.com/t/hyperpixel-4-0-touchscreen-rotate-with-display/8172) and [HyperPixel 4 - Touch screen dimensions are swapped](https://forums.pimoroni.com/t/hyperpixel-4-touch-screen-dimensions-are-swapped/8198) but I’m not sure what the exact state of display rotation (with touchscreen) for the Hyperpixel is. I tried `hyperpixel4:rotate` and `hyperpixel4:rotate_1` but the input is still inverted in Xorg.

Do I really need to recompile stuff to get this work? Or should this work out of the box? I installed the dirvers as described in `https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-hyperpixel-4`

If there’s additional installation/compiling needed, a step-by-step guide would be appreciated.

It would be great to have this basic feature covered in the FAQ at `https://github.com/pimoroni/hyperpixel/wiki`

---

<div class="post-metadata">

### Author: ![splitbrain](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/splitbrain/32/4777_2.png) [@splitbrain](https://forums.pimoroni.com/u/splitbrain)
#### Post date: [November 5, 2018, 11:27pm UTC](https://forums.pimoroni.com/t/hyperpixel-touch-rotate-screen-current-status/9075/2 "2018-11-05T23:27:36Z")

</div>

Trying to make sense of [Hyper Pixel - Rotate](https://forums.pimoroni.com/t/hyper-pixel-rotate/5276) I noticed that I do not have a `/usr/bin/hyperpixel-touch` or a `hyperpixel4-touch.service` - should those have been installed by the installer?

---

<div class="post-metadata">

### Author: ![splitbrain](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/splitbrain/32/4777_2.png) [@splitbrain](https://forums.pimoroni.com/u/splitbrain)
#### Post date: [November 5, 2018, 11:40pm UTC](https://forums.pimoroni.com/t/hyperpixel-touch-rotate-screen-current-status/9075/3 "2018-11-05T23:40:12Z")

</div>

Okay, I figured it out. Turns out I was looking at the wrong repository the whole time. For the HyperPixel4 there’s a repository at [https://github.com/pimoroni/hyperpixel4](https://github.com/pimoroni/hyperpixel4) which describes how to get the rotation working in the README.

It’s still a bit weird to me that the installer script isn’t doing the compile step for you. But at least I got it working in the end.

---

<div class="post-metadata">

### Author: ![fc-msm](https://avatars.discourse-cdn.com/v4/letter/f/65b543/32.png) [@fc-msm](https://forums.pimoroni.com/u/fc-msm)
#### Post date: [November 18, 2018, 9:05pm UTC](https://forums.pimoroni.com/t/hyperpixel-touch-rotate-screen-current-status/9075/4 "2018-11-18T21:05:54Z")

</div>

Thank you, @splitbrain! I needed this information today. Thanks for coming back with the answer.

I read the readme.md on the [https://github.com/pimoroni/hyperpixel4](https://github.com/pimoroni/hyperpixel4) page and the 180 degree rotation instructions are right there.

I found that somehow I had gotten the hyperpixel4 drivers installed with working touchscreen so all I needed to do was to

sudo nano /boot/config.txt and change the following lines:

1. Change `dtoverlay=hyperpixel4` to `dtoverlay=hyperpixel4:rotate`
2. Change `display_rotate=3` to `display_rotate=1`

For anyone else trying to rotate their hyperpixel 4 screen, who is a Linux noob like me, this might be helpful to know.

if you use the **pwd** command on raspbian you will find you’re you’re most likely starting off in the directory /home/pi if you are logged in as user “pi.”

So for you, the “/src” folder the instructions are referring to is probably located here:  
/home/pi/Pimoroni/hyperpixel4/src

You’ll have to cd /home/pi/Pimoroni/hyperpixel4/src and then run make from there.

---

<div class="post-metadata">

### Author: ![Pineapple-Jake](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/pineapple-jake/32/8882_2.png) [@Pineapple-Jake](https://forums.pimoroni.com/u/Pineapple-Jake)
#### Post date: [January 27, 2022, 10:37pm UTC](https://forums.pimoroni.com/t/hyperpixel-touch-rotate-screen-current-status/9075/5 "2022-01-27T22:37:41Z")

</div>

For the persistent 180 degree rotation of my HyperPixel4 Square Touch I did the following :

1. sudo cp /boot/config.txt /boot/config.txt.backup
2. sudo nano /boot/config.txt
3. Change `dtoverlay=hyperpixel4` to `dtoverlay=hyperpixel4:rotate`
4. **Add** the following line: `display_rotate=3` to `display_rotate= **2** `

The above nicely rotates the screen 180 degree (after a reboot). However the tocuhscreen is not rotated.

For which I did:

Modified the 98-hyperpixel4-square-calibration.rules

1. sudo cp /etc/udev/rules.d/98-hyperpixel4-square-calibration.rules /etc/udev/rules.d/98-hyperpixel4-square-calibration.rules.backup
2. sudo nano /etc/udev/rules.d/98-hyperpixel4-square-calibration.rules
3. Change ‘ATTRS{name}==“generic ft5x06 (11)”, ENV{LIBINPUT\_CALIBRATION\_MATRIX}=“ **1 0 0 0 1 0** ”’ to the following:  
‘ATTRS{name}==“generic ft5x06 (11)”, ENV{LIBINPUT\_CALIBRATION\_MATRIX}=" **-1 0 1 0 -1 1 0 0 1**"’

The above now rotates the touchscreen 1800 degree

Per the following touch screen rotation notes:

- 0 degrees of rotation parameters: Option “CalibrationMatrix” “1 0 0 0 1 0 0 0 1”
- 90 degrees of rotation parameters: Option “CalibrationMatrix” “0 1 0 0 -1 1 0 0 1”
- 180 degrees of rotation parameters: Option “CalibrationMatrix” “-1 0 1 0 -1 1 0 0 1”
- 270 degrees of rotation parameters: Option “CalibrationMatrix” “0-1 1 1 0 0 0 0 1”

Also see : [How to modify the display orientation-CTP(En) - LCD wiki](http://www.lcdwiki.com/How_to_modify_the_display_orientation-CTP(En))
