close

啟稿: 2018/04/18

完稿: 2018/04/19

 

Raspberry Pi派對PiRTY

LCD Test 01 : 3.5inch LCD for Retropie

LCD螢幕測試:3.5英吋LCD應用在Retropie

 

測試需求

可以支援樹莓派Framebuffer TFT LCD在專屬網站有介紹,相關資訊可以參考Raspberry GitHub:

https://github.com/notro/fbtft

使用Raspberry Pi常常需要顯示螢幕,最常見的就是與它一樣大小的3.5英吋的LCD螢幕,本測試就選用Waveshare微雪3.5inch RPi LCD應用在Retropie作業系統下的安裝,因為它在軟體安裝有優勢,因為它在Linux上有提供驅動程式的,如此在RaspbianRetropieUbuntu架設起來就會比較容易。

基本知識

測試Waveshare微雪3.5inch RPi LCD需要對樹莓派硬體與軟體有基本的知識如下:

  • 硬體方面:
    • LCD畫面輸出:在此要用Framebuffer TFT LCD,所以要有可支援樹莓派TFT LCD display的知識。
  • 軟體方面:
    • Retripie Framebuffer TFT LCD驅動程式安裝

材料與工具

需要如下所列的材料:

  • Raspberry Pi 2/3 B+                                                   x1
  • Waveshare微雪3.5inch RPi LCD                     x1

Test01-01.jpg

測試過程

 

架設TFT LCD的複雜過程在我另一篇網誌已經提過,各位可以參考以下此篇:

  • Step 1:安裝在RetropieSD卡中,插入SD卡,開啟樹莓派。
  • Step 2:移到Retropie Settings,選擇後進入Raspi Config,打開SSH
  • Step 3:連接無線網路WiFi
  • Step 4:另外準備一台電腦連接到樹莓派的有線網路,或同一無線網路AP連接知道此樹莓派IP address,確認你的連接電腦已安裝PuTTy WINSCP
  • Step 5:在連接電腦上執行WINSCP並以SFTP協議方式連到樹莓派,以你的用戶名pi和和密碼raspberry登入。
  • Step 6:從網路找到並下載LCD-show-161112.tar.gz,網址如下:
    http://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)
  • Step 7使用WINSCPLCD-show-161112.tar.gz連接電腦傳輸到主要retropie文件夾旁邊的sd卡的根目錄。
  • Step 8:用Putty連上樹莓派,以你的用戶名pi和和密碼raspberry登入。
  • Step 9:執行已下的命令
    cd
    curl -O
    https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/pitft-fbcp.sh
    sudo bash pitft-fbcp.sh
    輸入Y繼續,然後選擇選項14,這裡你必須手動去設定,這時候就會繼續安裝,出線如下的一堆資訊:

 

 

The programs included with the Debian GNU/Linux system are free software;

the exact distribution terms for each program are described in the

individual files in /usr/share/doc/*/copyright.

 

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent

permitted by applicable law.

Last login: Tue Mar 27 14:46:28 2018 from philipelitebook.local

 

   .~~.   .~~.    Tuesday, 27 March 2018,  2:56:38 pm UTC

  '. \ ' ' / .'   Linux 4.4.11-v7+ armv7l GNU/Linux

   .~ .~~~..~.

  : .~.'~'.~. :   Filesystem      Size  Used Avail Use% Mounted on

 ~ (   ) (   ) ~  /dev/root       6.4G  2.3G  3.9G  37% /

( : '~'.~.'~' : ) Uptime.............: 0 days, 00h15m16s

 ~ .~       ~. ~  Memory.............: 580880kB (Free) / 947748kB (Total)

  (   |   |   )   Running Processes..: 134

  '~         ~'   IP Address.........: 172.20.10.8

    *--~-~--*     Temperature........: CPU: 49°C/120°F GPU: 49°C/120°F

                  The RetroPie Project, https://retropie.org.uk

 

 

pi@retropie:~/RetroPie-Setup $ cd ..

pi@retropie:~ $ ls

LCD-show-171219.tar.gz  pitft-fbcp.sh  RetroPie  RetroPie-Setup

pi@retropie:~ $ sudo bash pitft-fbcp.sh

This script enables basic PiTFT display

support for portable gaming, etc.  Does

not cover X11, touchscreen or buttons

(see adafruit-pitft-helper for those).

HDMI output is set to PiTFT resolution,

not all monitors support this, PiTFT

may be only display after reboot.

Run time ~5 minutes. Reboot required.

 

CONTINUE? [y/N] y

 

Select project:

1. PiGRRL 2

2. Pocket PiGRRL

3. PiGRRL Zero

4. Cupcade (horizontal screen)

5. Cupcade (vertical screen)

6. Configure options manually

 

SELECT 1-6: 4

 

Device: pitft28-resistive

HDMI framebuffer rotate: 0

TFT MADCTL rotate: 90

 

CONTINUE? [y/N] y

 

Starting installation...

Updating package index files...

Hit http://mirrordirector.raspbian.org jessie InRelease

Hit http://archive.raspberrypi.org jessie InRelease

Hit http://mirrordirector.raspbian.org jessie/main armhf Packages

Hit http://archive.raspberrypi.org jessie/main armhf Packages

Hit http://mirrordirector.raspbian.org jessie/contrib armhf Packages

Hit http://archive.raspberrypi.org jessie/ui armhf Packages

Hit http://mirrordirector.raspbian.org jessie/non-free armhf Packages

Hit http://mirrordirector.raspbian.org jessie/rpi armhf Packages

Ign http://archive.raspberrypi.org jessie/main Translation-en_GB

Ign http://archive.raspberrypi.org jessie/main Translation-en

Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB

Ign http://archive.raspberrypi.org jessie/ui Translation-en

Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB

Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en

Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB

Ign http://mirrordirector.raspbian.org jessie/main Translation-en

Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB

Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en

Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB

Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en

Reading package lists... Done

Downloading and installing fbcp...

Reading package lists... Done

Building dependency tree

Reading state information... Done

cmake is already the newest version.

0 upgraded, 0 newly installed, 0 to remove and 242 not upgraded.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100   124    0   124    0     0     85      0 --:--:--  0:00:01 --:--:--    85

100  2045  100  2045    0     0    726      0  0:00:02  0:00:02 --:--:--  2274

Archive:  master.zip

8087a71d0330a078d91aa78656684ab5313616c6

   creating: rpi-fbcp-master/

 extracting: rpi-fbcp-master/.gitignore

  inflating: rpi-fbcp-master/CMakeLists.txt

  inflating: rpi-fbcp-master/README.md

  inflating: rpi-fbcp-master/main.c

-- The C compiler identification is GNU 4.9.2

-- The CXX compiler identification is GNU 4.9.2

-- Check for working C compiler: /usr/bin/cc

-- Check for working C compiler: /usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Detecting C compile features

-- Detecting C compile features - done

-- Check for working CXX compiler: /usr/bin/c++

-- Check for working CXX compiler: /usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- Configuring done

-- Generating done

-- Build files have been written to: /tmp/rpi-fbcp-master/build

Scanning dependencies of target fbcp

[ 50%] Building C object CMakeFiles/fbcp.dir/main.c.o

[100%] Linking C executable fbcp

[100%] Built target fbcp

Configuring PiTFT...

Done.

 

Settings take effect on next boot.

 

REBOOT NOW? [y/N]

在此之後,當您運行Retropie時,您的電視屏幕將被超級擠壓,並且有一些引導文本將顯示在液晶顯示器上。但不要擔心!重新啟動您的樹莓派。

  • Step 10:重新用Putty連到樹莓派並輸入以下命令

    sudo raspi-config

    一個選單會彈出。 轉到expand file-system並啟用。
    你也可以去啟動選項,並選擇桌面登錄;接下來執行下列命令:

    tar xvf LCD-show-*.tar.gz

    cd LCD-show/

    chmod +x LCD35-show

    ./LCD35-show

    重新啟動液晶顯示屏和HDMI後,會發現好像搞砸了;缺少圖標,缺少文字,無法訪問任何內容。這是一種亂象,但不要擔心

  • Step 11:重新再用Putty連到樹莓派並輸入以下命令

    cd RetroPie-Setup/

    sudo ./retropie-setup.sh

    這將帶你到Retropie菜單,選choose update all installed packages
    等到它完成。 重新啟動後,它應該在您的HDMI和液晶顯示屏上完美顯示!

     

其它設定

注意:一般LCD屏幕方向都朝向HDMI和頂部供電的方向,如果您想切換LCD屏幕方向,請運行以下命令:

cd LCD-show/

./LCD35-show 180

後記

本文為個人學習的經驗,後續有所改進將再發文分享;本人因工作因素發文後並不會經常檢視讀者問題,對於沒法及時回覆問題敬請見諒!

若覺本文對讀者有所幫助,可回覆感想及你的分享!謝謝!

arrow
arrow

    Philip4G 發表在 痞客邦 留言(0) 人氣()