惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Schneier on Security
N
News and Events Feed by Topic
量子位
S
Secure Thoughts
V2EX - 技术
V2EX - 技术
Hugging Face - Blog
Hugging Face - Blog
S
Security Affairs
J
Java Code Geeks
Schneier on Security
Schneier on Security
Google Online Security Blog
Google Online Security Blog
TaoSecurity Blog
TaoSecurity Blog
小众软件
小众软件
S
SegmentFault 最新的问题
www.infosecurity-magazine.com
www.infosecurity-magazine.com
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Security Archives - TechRepublic
Security Archives - TechRepublic
P
Privacy International News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
博客园 - 聂微东
T
Tor Project blog
博客园 - Franky
C
CERT Recently Published Vulnerability Notes
Cyberwarzone
Cyberwarzone
罗磊的独立博客
博客园_首页
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
Forbes - Security
Forbes - Security
V
Vulnerabilities – Threatpost
Security Latest
Security Latest
腾讯CDC
Simon Willison's Weblog
Simon Willison's Weblog
S
Securelist
博客园 - 【当耐特】
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threat Research - Cisco Blogs
博客园 - 司徒正美
AWS News Blog
AWS News Blog
WordPress大学
WordPress大学
Jina AI
Jina AI
G
GRAHAM CLULEY
V
V2EX
L
LINUX DO - 最新话题
H
Heimdal Security Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家

博客园 - Andy Yang

SharePoint中Event Handler的触发 扩展SharePoint链接字段 树莓派的连接 树莓派版的家用NAS服务器 修改树莓派更新源及设置代理配置 开启树莓派的硬件看门狗功能 树莓派上使用蚂蚁矿机挖矿 如何编译树莓派内核 代码导出Reporting Services报表文件 Bit-Coin收入的一分钱 如何在树莓派上运行雷神之锤III 新树莓派入手 如何通过PowerShell在Visual Studio的Post-build中预热SharePoint站点 将SharePoint 2010的快速启动改成弹出菜单样式 在SharePoint 2010的Team Site首页上显示Flash文件 SharePoint 2010搜索起步(下) SharePoint 2010搜索起步(上) 2009上班第一天 软件开发与心理张力
树莓派上安装2.8寸TFT触摸屏
Andy Yang · 2014-06-24 · via 博客园 - Andy Yang

在某宝的这里买了一个2.8寸的TFT触摸屏,其实就是中国版的ADAFRUIT

结合店家的帮助文档做了一下,一次点亮,这里也记录一下自己的安装过程(话说会硬件是会比会软件有不同的乐趣~~~

由于店家推荐使用Raspbian2013-09-25版本,所以我也换了一块SD卡重新安装了一遍

安装店家提供的2013-09-25版系统(参考树莓派的官网安装方法),更新系统

sudo apt-get update

sudo apt-get upgrade

//// 内核补丁

cd ~

// 下载内核补丁

wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-bin-adafruit.deb

wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-dev-adafruit.deb

wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-doc-adafruit.deb

wget http://adafruit-download.s3.amazonaws.com/libraspberrypi0-adafruit.deb

wget http://adafruit-download.s3.amazonaws.com/raspberrypi-bootloader-adafruit-112613.deb

// 安装内核补丁

sudo dpkg -i -B *.deb

// 重启

sudo reboot

//// 安装、测试TFT驱动

sudo modprobe spi-bcm2708

sudo modprobe fbtft_device name=adafruitts rotate=90

export FRAMEBUFFER=/dev/fb1

startx

//// 显示驱动自动加载

sudo nano /etc/modules

//增加以下两行

spi-bcm2708

fbtft_device

sudo nano /etc/modprobe.d/adafruit.conf

// 添加一行

options fbtft_device name=adafruitts rotate=90 frequency=32000000

sudo mkdir /etc/X11/xorg.conf.d

sudo nano /etc/X11/xorg.conf.d/99-calibration.conf

// 写入如下内容

Section "InputClass"
   Identifier      "calibration"
   MatchProduct    "stmpe-ts"
   Option  "Calibration"   "3800 120 200 3900"
   Option  "SwapAxes"      "1"
   Option "EmulateThirdButton" "1"
   Option "EmulateThirdButtonTimeout" "750"
   Option "EmulateThirdButtonMoveThreshold" "30"
EndSection

FRAMEBUFFER=/dev/fb1 startx

sudo nano ~/.profile

//在文件最后添加

export FRAMEBUFFER=/dev/fb1

// 重启

sudo reboot

// 矫正触摸

sudo nano /etc/udev/rules.d/95-stmpe.rules

//新加入如下内容

SUBSYSTEM=="input", ATTRS{name}=="stmpe-ts", ENV{DEVNAME}=="*event*", SYMLINK+="input/touchscreen"

//重新加载驱动

sudo rmmod stmpe_ts; sudo modprobe stmpe_ts

//查看会出现eventx)的事件(这步可做可不做)

ls -l /dev/input/touchscreen

//安装矫正的程序

sudo apt-get install evtest tslib libts-bin

//这里直接直接测试触摸硬件,系统打印坐标,ctrl+c结束(这步可做可不做)

sudo evtest /dev/input/touchscreen

//矫正开始

sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate

//矫正测试,可以当画图板,画图形:) ctrl+c结束

sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_test

//// 当终端显示器

sudo nano /boot/cmdline.txt

//rootwait 后面添加如下内容

fbcon=map:10 fbcon=font:VGA8x8

sudo dpkg-reconfigure console-setup

UTF-8 -Guess optimal character set -Terminus-6x12framebuffer only

以上字体比较适合2.8tft

//// 显示图像

sudo apt-get install fbi

wget http://adafruit-download.s3.amazonaws.com/adapiluv320x240.jpg

sudo fbi -T 2 -d /dev/fb1 -noverbose -a adapiluv320x240.jpg

//// 控制背光

sudo sh -c "echo 252 > /sys/class/gpio/export"

sudo ls -l /sys/class/gpio

sudo sh -c "echo 'out' > /sys/class/gpio/gpio252/direction"

// 关闭背光

sudo sh -c "echo '0' > /sys/class/gpio/gpio252/value"

// 开启背光

sudo sh -c "echo '1' > /sys/class/gpio/gpio252/value"

//// 开关机按钮控制

sudo nano /etc/modules

// 添加下行

rpi_power_switch

sudo nano /etc/modprobe.d/adafruit.conf

//增加下面内容,23号开关键就是最左侧的按钮

options rpi_power_switch gpio_pin=23 mode=0

sudo modprobe rpi_power_switch

//// 播放动画

sudo apt-get install mplayer

wget http://adafruit-download.s3.amazonaws.com/bigbuckbunny320p.mp4

mplayer -vo fbdev2:/dev/fb1 -x 240 -y 320 -framedrop bigbuckbunny320p.mp4

效果图

参考文档

http://www.arduinoking.com/forum.php?mod=viewthread&tid=1&extra=page%3D1

http://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi?view=all

Andy Yang

2014.06.24