Skip to content

Instantly share code, notes, and snippets.

@akinazuki
Forked from JdaieLin/1.3_LCD_HAT_install.md
Created March 23, 2019 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akinazuki/cb1cb6dd74581e2395714c18e1ec8a88 to your computer and use it in GitHub Desktop.
Save akinazuki/cb1cb6dd74581e2395714c18e1ec8a88 to your computer and use it in GitHub Desktop.
Install waveshare 1.3 LCD HAT on Raspbian

在树莓派上点亮微雪1.3寸LCD HAT所需的安装步骤,重新梳理了一下安装顺序。

使用最新Raspbian镜像,联网进行安装。

安装 WiringPi

cd ~
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build

检查是否安装成功

gpio -v

安装bcm2835函数库

cd ~
wget http://www.waveshare.net/w/upload/d/d8/Bcm2835-1.45.tar.gz
tar zvxf Bcm2835-1.45.tar.gz
cd bcm2835-1.45
./configure
make
sudo make check
sudo make install

安装python相关函数库

sudo apt-get update
sudo apt-get install python-dev
sudo apt-get install python-smbus
sudo apt-get install python-serial
pip install RPi.GPIO
pip install spidev
pip install python-imaging

添加模块到/etc/modules

sudo nano /etc/modules
# append following two lines to the end
# 将以下两行添加至文件结尾
i2c-bcm2708
i2c-dev

修改系统配置

sudo raspi-config
# Enter Interfacing Options, turn on SPI, I2C, Serial
# 进入Interfacing Options,开启SPI, I2C, Serial

获取demo程序

cd ~
wget http://www.waveshare.net/w/upload/c/c9/1.3inch_LCD_HAT.tar.gz
tar zxvf 1.3inch_LCD_HAT.tar.gz

运行demo程序(bcm2835,可测试按键是否可用)

cd ~
cd 1.3inch_LCD_HAT/bcm2835/
sudo ./lcd_1in3 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment