{"id":533,"date":"2018-08-28T07:40:44","date_gmt":"2018-08-28T05:40:44","guid":{"rendered":"https:\/\/www.raulet.net\/WP\/?page_id=533"},"modified":"2018-08-28T07:41:20","modified_gmt":"2018-08-28T05:41:20","slug":"raspberry-pi-lcd-3-5inch-rpi-lcd-a","status":"publish","type":"page","link":"https:\/\/www.raulet.net\/WP\/datasheet\/raspberry-pi\/raspberry-pi-lcd-3-5inch-rpi-lcd-a\/","title":{"rendered":"3.5inch RPi LCD (A)"},"content":{"rendered":"<p><a href=\"https:\/\/www.waveshare.com\/wiki\/3.5inch_RPi_LCD_(A)\">https:\/\/www.waveshare.com\/wiki\/3.5inch_RPi_LCD_(A)<\/a><\/p>\n<h2><span id=\"Introduction\" class=\"mw-headline\">Introduction<\/span><\/h2>\n<p>3.5 inch Touch Screen TFT LCD Designed for Raspberry Pi<\/p>\n<table>\n<tbody>\n<tr>\n<td><a class=\"external text\" href=\"http:\/\/www.waveshare.com\/product\/3.5inch-RPi-LCD-A.htm\" target=\"_blank\" rel=\"nofollow noopener\">More<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span id=\"Getting_Started\" class=\"mw-headline\">Getting Started<\/span><\/h2>\n<p>The RPi LCD can be driven in two ways: Method 1. install driver to your Raspbian OS. Method 2. use the Ready-to-use image file of which LCD driver was pre-installed.<\/p>\n<h3><span id=\"Method_1._Driver_installation\" class=\"mw-headline\">Method 1. Driver installation<\/span><\/h3>\n<p>1. Configure your Pi:<\/p>\n<pre>sudo raspi-config\r\n<\/pre>\n<p>Set as:<\/p>\n<ul>\n<li>Select Expand Filesystem.<\/li>\n<li>Boot Option -&gt; Desktop Autologin (may differ depending on Raspbian revision)<\/li>\n<\/ul>\n<p>2. Copy the driver <a href=\"https:\/\/www.waveshare.com\/wiki\/3.5inch_RPi_LCD_(A)#Driver\">(choose the driver according to your OS)<\/a> into your OS then Run the following commands:<\/p>\n<pre>tar xvf LCD-show-*.tar.gz\r\ncd LCD-show\/\r\n<\/pre>\n<p>Install the driver and it toggles the mode to LCD display: <b>Note: Net work connection is required while installing driver to your Pi, or else the touch won&rsquo;t work properly.<\/b><\/p>\n<pre>chmod +x LCD35-show\r\n.\/LCD35-show\r\n<\/pre>\n<p><i>Note: this LCD won&rsquo;t work after apt-get upgrade, in such cases, please edit the config.txt file in the SD card and remove this statement: <code>dtoverlay=ads7846<\/code><\/i><\/p>\n<p>3. After system rebooting, the RPi LCD is ready to use.<\/p>\n<h3><span id=\"Method_2._Using_Ready-to-use_image\" class=\"mw-headline\">Method 2. Using Ready-to-use image<\/span><\/h3>\n<p>The image file with pre-installed driver is located in the IMAGE directory of the CD, or you can download it from <a href=\"https:\/\/www.waveshare.com\/wiki\/3.5inch_RPi_LCD_(A)#Image\">#Image<\/a>. Extract the .7z file and you will get an .img file. Write the image to your micro SD card (How to write an image to a micro SD card for your Pi? See <a title=\"RPi-Image-Installation-Guides\" href=\"https:\/\/www.waveshare.com\/wiki\/RPi-Image-Installation-Guides\">RPi Image Installation Guides<\/a> for more details). Then insert the card to your Pi, power up and enjoy it.<\/p>\n<h2><span id=\"Toggle_between_LCD_and_HDMI_display\" class=\"mw-headline\">Toggle between LCD and HDMI display<\/span><\/h2>\n<p>Once this LCD is enabled, meanwhile the default settings for HDMI are changed. If you want to use another HDMI monitor, please run the following command:<\/p>\n<pre>cd LCD-show\/\r\n.\/LCD-hdmi\r\n<\/pre>\n<p>This toggles the mode to LCD display:<\/p>\n<pre>.\/LCD35-show<\/pre>\n<h2><span id=\"Screen_orientation_settings\" class=\"mw-headline\">Screen orientation settings<\/span><\/h2>\n<p>After touch driver installed, the screen orientation can be set by these commands:<\/p>\n<ul>\n<li>0 degree rotation<\/li>\n<\/ul>\n<pre>cd LCD-show\/\r\n.\/LCD35-show 0\r\n<\/pre>\n<ul>\n<li>90 degree rotation<\/li>\n<\/ul>\n<pre>cd LCD-show\/\r\n.\/LCD35-show 90\r\n<\/pre>\n<ul>\n<li>180 degree rotation<\/li>\n<\/ul>\n<pre>cd LCD-show\/\r\n.\/LCD35-show 180\r\n<\/pre>\n<ul>\n<li>270 degree rotation<\/li>\n<\/ul>\n<pre>cd LCD-show\/\r\n.\/LCD35-show 270\r\n<\/pre>\n<h2><span id=\"Touch_screen_calibration\" class=\"mw-headline\">Touch screen calibration<\/span><\/h2>\n<p>This LCD can be calibrated using a program called xinput_calibrator which is pre-installed on the CD image. However, it was not pre-installed on original Raspbian OS. So in this case, you should get and install the program manually with<\/p>\n<pre>sudo apt-get install -y xinput-calibrator\r\n<\/pre>\n<p>Enter the following commands for touch screen calibration:<\/p>\n<pre>sudo DISPLAY=:0.0 xinput_calibrator\r\n<\/pre>\n<p>or select Menu -&gt; Preferences -&gt; Calibrate Touchscreen.<\/p>\n<p>After running these commands, there will be a prompt for four-point calibration shown in the LCD screen. Click the points one by one to finish the touch calibration. Then, the new calibration data will be displayed in the terminal, as shows below. Please get these data for future use.<\/p>\n<pre>Doing dynamic recalibration:\r\nSetting new calibration data: 3919, 208, 236, 3913\r\n<\/pre>\n<p>Enter the following command to edit 99-calibration.conf:<\/p>\n<pre>sudo nano \/etc\/X11\/xorg.conf.d\/99-calibration.conf\r\n<\/pre>\n<p>Then, the old calibration data will be displayed in the terminal:<\/p>\n<pre>Section \"InputClass\"\r\nIdentifier\t\"calibration\"\r\nMatchProduct\t\"ADS7846 Touchscreen\"\r\nOption\t\"Calibration\"\t\"160 3723 3896 181\"\r\nOption\t\"SwapAxes\"\t\"1\"\r\nEndSection\r\n<\/pre>\n<p>Modify the calibration data to the new calibration data displayed above):<\/p>\n<pre>Section \"InputClass\"\r\nIdentifier\t\"calibration\"\r\nMatchProduct\t\"ADS7846 Touchscreen\"\r\nOption\t\"Calibration\"\t\"3919 208 236 3913\"\r\nOption\t\"SwapAxes\"\t\"1\"\r\nEndSection\r\n<\/pre>\n<p>Press the keys Ctrl+X, and select the option Y to save the modification.<\/p>\n<p>The modification will be valid after rebooting the system. Enter the following command for system reboot:<\/p>\n<pre>sudo reboot\r\n<\/pre>\n<p><b>Notices: In case of inaccurate touch, please perform screen calibration again and reboot the system.<\/b><\/p>\n<h2><span id=\"Install_Virtual_Keyabord\" class=\"mw-headline\">Install Virtual Keyabord<\/span><\/h2>\n<p>1. Install matchbox-keyboard<\/p>\n<pre>sudo apt-get install update\r\nsudo apt-get install matchbox-keyboard\r\nsudo nano \/usr\/bin\/toggle-matchbox-keyboard.sh\r\n<\/pre>\n<p>2. Copy the statements below to toggle-matchbox-keyboard.sh and save.<\/p>\n<pre>#!\/bin\/bash\r\n#This script toggle the virtual keyboard\r\nPID=`pidof matchbox-keyboard`\r\nif [\u00a0! -e $PID ]; then\r\nkillall matchbox-keyboard\r\nelse\r\nmatchbox-keyboard -s 50 extended&amp;\r\nfi\r\n<\/pre>\n<p>3. Execute the commands:<\/p>\n<pre>sudo chmod +x \/usr\/bin\/toggle-matchbox-keyboard.sh\r\nsudo mkdir \/usr\/local\/share\/applications\r\nsudo nano \/usr\/local\/share\/applications\/toggle-matchbox-keyboard.desktop\r\n<\/pre>\n<p>4. Copy the statements to toggle-matchbox-keyboard.desktop and save.<\/p>\n<pre>[Desktop Entry]\r\nName=Toggle Matchbox Keyboard\r\nComment=Toggle Matchbox Keyboard`\r\nExec=toggle-matchbox-keyboard.sh\r\nType=Application\r\nIcon=matchbox-keyboard.png\r\nCategories=Panel;Utility;MB\r\nX-MB-INPUT-MECHANSIM=True\r\n<\/pre>\n<p>5. Execute commands as below. <b>Note that you need to use \u00ab\u00a0Pi \u00a0\u00bb user permission instead of root to execute this command<\/b><\/p>\n<pre>nano ~\/.config\/lxpanel\/LXDE-pi\/panels\/panel\r\n<\/pre>\n<p>6. Find the statement which is similar to below: (It maybe different in different version)<\/p>\n<pre>Plugin {\r\ntype = launchbar\r\nConfig {\r\nButton {\r\nid=lxde-screenlock.desktop\r\n}\r\nButton {\r\nid=lxde-logout.desktop\r\n}\r\n}\r\n<\/pre>\n<p>7. Append these statements to add an button option:<\/p>\n<pre>Button {\r\nid=\/usr\/local\/share\/applications\/toggle-matchbox-keyboard.desktop\r\n}\r\n<\/pre>\n<p><a class=\"image fancybox\" href=\"https:\/\/www.waveshare.com\/wiki\/File:RPILCD-INSTALL-KEYBOARD01.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.waveshare.com\/w\/thumb.php?f=RPILCD-INSTALL-KEYBOARD01.png&amp;width=400\" srcset=\"\/w\/upload\/5\/52\/RPILCD-INSTALL-KEYBOARD01.png 1.5x, \/w\/upload\/5\/52\/RPILCD-INSTALL-KEYBOARD01.png 2x\" alt=\"RPILCD-INSTALL-KEYBOARD01.png\" width=\"400\" height=\"380\" \/><\/a><\/p>\n<p>8. reboot your Raspberry Pi. If the virtual keyboard is installed correctly, you can find that there is a keyboard icon on the left of the bar<\/p>\n<pre>sudo reboot\r\n<\/pre>\n<h2><span id=\"How_to_work_with_a_camera\" class=\"mw-headline\">How to work with a camera<\/span><\/h2>\n<p>1. Select \u00ab\u00a0Enable Camera\u00a0\u00bb -&gt; \u00ab\u00a0&lt;YES&gt;\u00a0\u00bb<\/p>\n<pre>sudo raspi-config\r\n<\/pre>\n<p>2. Copy the <a title=\"File:RPi-Camera-Driver-for-GPIO-LCD.zip\" href=\"https:\/\/www.waveshare.com\/wiki\/File:RPi-Camera-Driver-for-GPIO-LCD.zip\">Camera driver<\/a> to the OS of Pi then:<\/p>\n<pre>unzip camera.zip\r\ncd camera\r\nsudo chmod 777 Camera\r\nsudo cp update\\ camera\/95-stmpe.rules \/etc\/udev\/rules.d\/\r\n<\/pre>\n<p>3. Create a file called wheezy.list.<\/p>\n<pre>sudo nano \/etc\/apt\/sources.list.d\/wheezy.list\r\n<\/pre>\n<p>Append:<\/p>\n<pre>deb http:\/\/archive.raspbian.org\/raspbian wheezy main\r\n<\/pre>\n<p>Exit with save.<\/p>\n<p>4. Create a file called 10defaultRelease.<\/p>\n<pre>sudo nano \/etc\/apt\/apt.conf.d\/10defaultRelease\r\n<\/pre>\n<p>Append:<\/p>\n<pre>APT::Default-release \\\"stable\";\r\n<\/pre>\n<p>Exit with save.<\/p>\n<p>5. Create a file called libsdl.<\/p>\n<pre>sudo nano \/etc\/apt\/preferences.d\/libsdl\r\n<\/pre>\n<p>Append:<\/p>\n<pre>Package: libsdl1.2debian\r\nPin: release n=jessie\r\nPin-Priority: -10\r\nPackage: libsdl1.2debian\r\nPin: release n=wheezy\r\nPin-Priority: 900\r\n<\/pre>\n<p>Exit with save.<\/p>\n<p>6. Last, execute the commands:<\/p>\n<pre>sudo apt-get update\r\nsudo apt-get -y --force-yes install libsdl1.2debian\/wheezy\r\nsudo apt-get install evtest tslib libts-bin xinput\r\nsudo apt-get install python-pip \r\nsudo apt-get install python2.7-dev\r\nsudo pip install picamera==1.10 \r\nsudo reboot\r\nsudo TSLIB_FBDEVICE=\/dev\/fb1 TSLIB_TSDEVICE=\/dev\/input\/touchscreen ts_calibrate\r\n<\/pre>\n<p>Camera will be enabled by the steps above.<\/p>\n<h2><span id=\"Resource\" class=\"mw-headline\">Resource<\/span><\/h2>\n<ul>\n<li><a class=\"external text\" href=\"http:\/\/www.waveshare.com\/w\/upload\/3\/3e\/RPi-LCD-User-Manual.pdf\" target=\"_blank\" rel=\"nofollow noopener\">User manual<\/a><\/li>\n<\/ul>\n<h3><span id=\"Image\" class=\"mw-headline\">Image<\/span><\/h3>\n<p>Description: if you felt hard to install driver, try the image with driver pre-installed.<\/p>\n<ul>\n<li><a class=\"external text\" href=\"https:\/\/drive.google.com\/open?id=1xsvANujoImwVQvdf0n7IiUjP8BuCe2GK\" target=\"_blank\" rel=\"nofollow noopener\">RPi-35inch-LCD-(A)-Raspbian-180326.7z<\/a><\/li>\n<\/ul>\n<h3><span id=\"Driver\" class=\"mw-headline\">Driver<\/span><\/h3>\n<p>This driver is for Raspbian after 170703 version. Network connection is required when installing.<\/p>\n<ul>\n<li><a class=\"external text\" href=\"https:\/\/www.waveshare.com\/w\/upload\/3\/34\/LCD-show-180331.tar.gz\" target=\"_blank\" rel=\"nofollow noopener\">LCD-show-180331.tar.gz<\/a><\/li>\n<\/ul>\n<h3><span id=\"Software\" class=\"mw-headline\">Software<\/span><\/h3>\n<ul>\n<li><a class=\"external text\" href=\"http:\/\/www.waveshare.com\/w\/upload\/d\/d7\/Panasonic_SDFormatter.zip\" target=\"_blank\" rel=\"nofollow noopener\">Panasonic SDFormatter<\/a><\/li>\n<li><a class=\"external text\" href=\"http:\/\/www.waveshare.com\/w\/upload\/7\/76\/Win32DiskImager.zip\" target=\"_blank\" rel=\"nofollow noopener\">Win32DiskImager<\/a><\/li>\n<li><a class=\"external text\" href=\"http:\/\/www.waveshare.com\/w\/upload\/5\/56\/Putty.zip\" target=\"_blank\" rel=\"nofollow noopener\">PuTTY<\/a><\/li>\n<\/ul>\n<h3><span id=\"LCD_Panel_Dimension\" class=\"mw-headline\">LCD Panel Dimension<\/span><\/h3>\n<ul>\n<li><a class=\"external text\" href=\"http:\/\/www.waveshare.com\/w\/upload\/0\/0c\/3.5inch-rpi-lcd-a-panel-dimension.pdf\" target=\"_blank\" rel=\"nofollow noopener\">3.5inch RPi LCD (A) panel dimension<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/www.waveshare.com\/wiki\/3.5inch_RPi_LCD_(A) Introduction 3.5 inch Touch Screen TFT LCD Designed for Raspberry Pi More Getting Started The RPi LCD can be [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":223,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-533","page","type-page","status-publish","hentry"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"arnaud","author_link":"https:\/\/www.raulet.net\/WP\/author\/arnaud\/"},"uagb_comment_info":0,"uagb_excerpt":"https:\/\/www.waveshare.com\/wiki\/3.5inch_RPi_LCD_(A) Introduction 3.5 inch Touch Screen TFT LCD Designed for Raspberry Pi More Getting Started The RPi LCD can be [&hellip;]","_links":{"self":[{"href":"https:\/\/www.raulet.net\/WP\/wp-json\/wp\/v2\/pages\/533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.raulet.net\/WP\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.raulet.net\/WP\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.raulet.net\/WP\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.raulet.net\/WP\/wp-json\/wp\/v2\/comments?post=533"}],"version-history":[{"count":5,"href":"https:\/\/www.raulet.net\/WP\/wp-json\/wp\/v2\/pages\/533\/revisions"}],"predecessor-version":[{"id":571,"href":"https:\/\/www.raulet.net\/WP\/wp-json\/wp\/v2\/pages\/533\/revisions\/571"}],"up":[{"embeddable":true,"href":"https:\/\/www.raulet.net\/WP\/wp-json\/wp\/v2\/pages\/223"}],"wp:attachment":[{"href":"https:\/\/www.raulet.net\/WP\/wp-json\/wp\/v2\/media?parent=533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}