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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - Andy Yang

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

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