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

推荐订阅源

A
About on SuperTechFans
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tenable Blog
WordPress大学
WordPress大学
小众软件
小众软件
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
T
The Exploit Database - CXSecurity.com
Attack and Defense Labs
Attack and Defense Labs
Simon Willison's Weblog
Simon Willison's Weblog
C
CXSECURITY Database RSS Feed - CXSecurity.com
量子位
有赞技术团队
有赞技术团队
C
Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
F
Fortinet All Blogs
S
Schneier on Security
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
Stack Overflow Blog
Stack Overflow Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
Spread Privacy
Spread Privacy
F
Full Disclosure
Scott Helme
Scott Helme
GbyAI
GbyAI
N
Netflix TechBlog - Medium
MyScale Blog
MyScale Blog
Cloudbric
Cloudbric
云风的 BLOG
云风的 BLOG
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
Hacker News - Newest:
Hacker News - Newest: "LLM"
Security Latest
Security Latest
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
The Register - Security
The Register - Security
L
Lohrmann on Cybersecurity
PCI Perspectives
PCI Perspectives
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
D
Docker
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Secure Thoughts
C
Check Point Blog

博客园 - 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