“RPi Touch Keypad”的版本间的差异
来自Waveshare Wiki
Waveshare-admin(讨论 | 贡献) 小 (替换文字 - 「 {|style="width:auto" | {|class="at-c" style="table-layout:fixed;border-radius:100px;width:100%;border:2px solid #{{{bordercolor}}}" |- |class="bg-Joinus roundy-100 hide" style="table-layout:fixed;border-radius:100px;padding:10px;width:1) |
小 (文本替换 - 替换“<h1>售后</h1>”为“<h1>技术支持</h1>”) |
||
(未显示3个用户的23个中间版本) | |||
第1行: | 第1行: | ||
+ | <div class="tabberlive newwsnav" id="wsnavbar"> | ||
+ | <ul class="tabbernav"> | ||
+ | <li class="nav-link">[[#myintro|说明]]</li> | ||
+ | <li class="nav-link">[[#myresources|资料]]</li> | ||
+ | <li class="nav-link">[[#myfaq|FAQ]]</li> | ||
+ | <li class="nav-link">[[#mysupport|售后]]</li> | ||
+ | </ul> | ||
+ | </div> | ||
<div class="tabber"> | <div class="tabber"> | ||
− | |||
− | |||
{{外围模块|colorscheme=blue | {{外围模块|colorscheme=blue | ||
|name = RPi Touch Keypad | |name = RPi Touch Keypad | ||
− | |img=[[File:RPi-Touch-Keypad-1.jpg|360px |alt=RPi Touch Keypad|link= | + | |img=[[File:RPi-Touch-Keypad-1.jpg|360px |alt=RPi Touch Keypad|link=https://{{SERVERNAME}}/shop/RPi-Touch-Keypad.htm | RPi Touch Keypad]] |
|category1=树莓派 | |category1=树莓派 | ||
|brand=Waveshare | |brand=Waveshare | ||
第12行: | 第18行: | ||
|interface1 = I2C | |interface1 = I2C | ||
}} | }} | ||
+ | |||
+ | <div class="tabbertab" title="说明" id="myintro"> | ||
+ | |||
+ | <h1>说明</h1> | ||
+ | |||
+ | =树莓派使用= | ||
+ | {{RPI_open_i2c}} | ||
+ | |||
+ | ==安装库== | ||
+ | {{RPI_C_lib}} | ||
+ | *安装Python函数库 | ||
+ | <pre> | ||
+ | sudo apt-get update | ||
+ | sudo apt-get install python-smbus | ||
+ | </pre> | ||
+ | |||
+ | ==使用== | ||
+ | *下载示例程序,并解压进入指定目录: | ||
+ | <pre> | ||
+ | sudo apt-get install p7zip | ||
+ | wget http://www.waveshare.net/w/upload/5/50/RPi_Touch_Keypad_code.7z | ||
+ | 7zr x RPi_Touch_Keypad_code.7z -r -o./RPi_Touch_Keypad_code | ||
+ | sudo chmod 777 -R RPi_Touch_Keypad_code | ||
+ | cd RPi_Touch_Keypad_code | ||
+ | </pre> | ||
+ | |||
+ | *C程序 | ||
+ | <pre> | ||
+ | cd c | ||
+ | make | ||
+ | sudo ./TTP229 | ||
+ | </pre> | ||
+ | 会打印出对应的二进制码<br /> | ||
+ | |||
+ | *python程序 | ||
+ | <pre> | ||
+ | cd python | ||
+ | sudo python TTP229.py | ||
+ | </pre> | ||
+ | 会打印出对应的二进制码<br /> | ||
+ | 对于python例程是直接调用.so文件的方式,示例程序中提供了.so的源码,如果你需要对其做修改,可以重新编译生产.so: | ||
+ | <pre> | ||
+ | gcc -fPIC -shared TTP229.c -o TTP229.so | ||
+ | </pre> | ||
+ | </div> | ||
+ | |||
+ | <div class="tabbertab" title="资料" id="myresources"> | ||
+ | |||
+ | <h1>资料</h1> | ||
+ | |||
===文档=== | ===文档=== | ||
− | *[ | + | *[https://{{SERVERNAME}}/w/upload/a/af/RPi-Touch-Keypad.pdf 原理图]<br> |
===视频=== | ===视频=== | ||
*[[RPi-Touch-Keypad-Video|演示视频]][[File:video-logo.png|23px|link=RPi-Touch-Keypad-Video]] | *[[RPi-Touch-Keypad-Video|演示视频]][[File:video-logo.png|23px|link=RPi-Touch-Keypad-Video]] | ||
===程序=== | ===程序=== | ||
− | *[ | + | *[https://{{SERVERNAME}}/w/upload/5/50/RPi_Touch_Keypad_code.7z 示例程序]<br> |
+ | |||
===软件=== | ===软件=== | ||
*[[DVK512_Software|开发软件]] | *[[DVK512_Software|开发软件]] | ||
第24行: | 第81行: | ||
===相关链接=== | ===相关链接=== | ||
{{Raspberry Pi Study}} | {{Raspberry Pi Study}} | ||
− | |||
− | + | ||
+ | |||
</div> | </div> | ||
− | <div class="tabbertab" title="FAQ"><br /></div> | + | <div class="tabbertab" title="FAQ" id="myfaq"> |
− | <div class="tabbertab" title="售后"><br />{{ | + | |
+ | <h1>FAQ</h1> | ||
+ | <br /></div> | ||
+ | <div class="tabbertab" title="售后" id="mysupport"> | ||
+ | |||
+ | <h1>技术支持</h1> | ||
+ | <br />{{Service03}}</div> |
2022年8月11日 (四) 17:13的最新版本
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
说明
树莓派使用
开启I2C接口
- 打开树莓派终端,输入以下指令进入配置界面
sudo raspi-config 选择 Interfacing Options -> I2C ->yes 启动 i2C 内核驱动
sudo reboot
安装库
如果使用bookworm系统,只能使用lgpio库,bcm2835跟wiringPi无法安装与使用
BCM2835
#打开树莓派终端,并运行以下指令 wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz tar zxvf bcm2835-1.71.tar.gz cd bcm2835-1.71/ sudo ./configure && sudo make && sudo make check && sudo make install # 更多的可以参考官网:http://www.airspayce.com/mikem/bcm2835/
wiringPi
#打开树莓派终端,并运行以下指令 cd sudo apt-get install wiringpi #对于树莓派2019年5月之后的系统(早于之前的可不用执行),可能需要进行升级: wget https://project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb gpio -v # 运行gpio -v会出现2.52版本,如果没有出现说明安装出错 #Bullseye分支系统使用如下命令: git clone https://github.com/WiringPi/WiringPi cd WiringPi ./build gpio -v # 运行gpio -v会出现2.70版本,如果没有出现说明安装出错
lgpio
#打开树莓派终端,并运行以下指令 wget https://github.com/joan2937/lg/archive/master.zip unzip master.zip cd lg-master sudo make install # 更多的可以参考官网:https://github.com/gpiozero/lg
- 安装Python函数库
sudo apt-get update sudo apt-get install python-smbus
使用
- 下载示例程序,并解压进入指定目录:
sudo apt-get install p7zip wget http://www.waveshare.net/w/upload/5/50/RPi_Touch_Keypad_code.7z 7zr x RPi_Touch_Keypad_code.7z -r -o./RPi_Touch_Keypad_code sudo chmod 777 -R RPi_Touch_Keypad_code cd RPi_Touch_Keypad_code
- C程序
cd c make sudo ./TTP229
会打印出对应的二进制码
- python程序
cd python sudo python TTP229.py
会打印出对应的二进制码
对于python例程是直接调用.so文件的方式,示例程序中提供了.so的源码,如果你需要对其做修改,可以重新编译生产.so:
gcc -fPIC -shared TTP229.c -o TTP229.so
资料
文档
视频
程序
软件
数据手册
相关链接