Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Screen orientation on Raspberry Pi 3 with Android things

I've just bought a Raspberry Pi 3 with a 7" Display touch screen and a casing.

Unfortunately, the casing can't allow me to rotate manually the screen so my apps are running upside down.

I've tried to do it from the console using the following adb commands but with no luck:

adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0

Then

adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1

Or

adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:3

Is there any way to do it from a config flag directly that screen orientation is handled from boot ?

like image 452
Bibu Avatar asked Jan 09 '17 23:01

Bibu


People also ask

How do I change the screen orientation on my Raspberry Pi 3?

Head to your Pi desktop and click on the Pin icon on the top left of the display. Hover on the preferences option and click on “Screen configuration”. Select the display you wish to rotate. Hover over orientation and choose the way you want to modify your Display.

How do I manage screen orientation on Android?

If you want to manually handle orientation changes in your app you must declare the "orientation" , "screenSize" , and "screenLayout" values in the android:configChanges attributes. You can declare multiple configuration values in the attribute by separating them with a pipe | character.

How do I rotate my Raspberry Pi screen?

Step 1: Go to the main menu of Raspberry Pi and click on the “Screen Configuration” option in the “Preferences” section. Step 2: Now, right click on the “HDMI-2” option and in the “Orientation” section, click on the “inverted” option. You can also pick “right” and “left” options.


1 Answers

I find out finally how to achieve it.

Solution found there : Android Things with Rasp3 7 inch touchscreen

You have to mount the boot partition from the sdcard on your laptop and edit the /boot/config.txt file and add the following line:

lcd_rotate=2

By adding this line both display and touchscreen will be rotated, compared to display_rotate=2 where only display is rotated and touchscreen remains upside down.

like image 180
Bibu Avatar answered Oct 27 '22 01:10

Bibu