模板:RPILCD-CAMERA

来自丢石头百科
Admin讨论 | 贡献2019年11月14日 (四) 16:20的版本 (文本替换 - 替换“</source>”为“</syntaxhighlight>”)

搭配摄像头使用

1.运行以下命令,选择"Enable Camera"->"<YES>" <source lang="c"> sudo raspi-config </syntaxhighlight>

2.复制摄像头驱动到树莓派的文件系统,并执行以下命令 <source lang="c"> unzip camera.zip cd camera sudo chmod 777 Camera sudo cp update\ camera/95-stmpe.rules /etc/udev/rules.d/ </syntaxhighlight>

3.执行以下命令新建文件wheezy.list <source lang="c"> sudo nano /etc/apt/sources.list.d/wheezy.list </syntaxhighlight>

添加以下内容并保存 <source lang="c"> deb http://archive.raspbian.org/raspbian wheezy main </syntaxhighlight>

4.执行以下命令新建文件10defaultRelease <source lang="c"> sudo nano /etc/apt/apt.conf.d/10defaultRelease </syntaxhighlight>

添加以下内容并保存 <source lang="c"> APT::Default-release \"stable"; </syntaxhighlight>

5.执行以下命令新建文件libsdl <source lang="c"> sudo nano /etc/apt/preferences.d/libsdl </syntaxhighlight>

添加以下内容并保存 <source lang="c"> Package: libsdl1.2debian Pin: release n=jessie Pin-Priority: -10 Package: libsdl1.2debian Pin: release n=wheezy Pin-Priority: 900 </syntaxhighlight>

6.执行以下命令 <source lang="c"> sudo apt-get update sudo apt-get -y --force-yes install libsdl1.2debian/wheezy sudo apt-get install evtest tslib libts-bin xinput sudo apt-get install python-pip sudo apt-get install python2.7-dev sudo pip install picamera==1.10 sudo reboot sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate </syntaxhighlight>

执行完上面6个步骤,Camera功能将可以正常使用。