“模板:RPILCD-CAMERA”的版本间的差异

来自丢石头百科
(文本替换 - 替换“http://www.waveshare.net/w/upload”为“http://{{SERVERNAME}}/w/upload”)
(文本替换 - 替换“</source>”为“</syntaxhighlight>”)
第8行: 第8行:
 
cd camera/
 
cd camera/
 
./Camera
 
./Camera
</source>
+
</syntaxhighlight>
  
 
等待数秒后,照相机应用开始启动,双击屏幕即可抓拍图片。
 
等待数秒后,照相机应用开始启动,双击屏幕即可抓拍图片。
第17行: 第17行:
 
<source lang="c">
 
<source lang="c">
 
sudo raspi-config
 
sudo raspi-config
</source>
+
</syntaxhighlight>
  
 
2.复制[http://{{SERVERNAME}}/w/upload/a/a8/Camera.zip 摄像头驱动]到树莓派的文件系统,并执行以下命令
 
2.复制[http://{{SERVERNAME}}/w/upload/a/a8/Camera.zip 摄像头驱动]到树莓派的文件系统,并执行以下命令
第25行: 第25行:
 
sudo chmod 777 Camera
 
sudo chmod 777 Camera
 
sudo cp update\ camera/95-stmpe.rules /etc/udev/rules.d/
 
sudo cp update\ camera/95-stmpe.rules /etc/udev/rules.d/
</source>
+
</syntaxhighlight>
  
 
3.执行以下命令新建文件wheezy.list
 
3.执行以下命令新建文件wheezy.list
 
<source lang="c">
 
<source lang="c">
 
sudo nano /etc/apt/sources.list.d/wheezy.list
 
sudo nano /etc/apt/sources.list.d/wheezy.list
</source>
+
</syntaxhighlight>
  
 
添加以下内容并保存
 
添加以下内容并保存
 
<source lang="c">
 
<source lang="c">
 
deb http://archive.raspbian.org/raspbian wheezy main  
 
deb http://archive.raspbian.org/raspbian wheezy main  
</source>
+
</syntaxhighlight>
  
 
4.执行以下命令新建文件10defaultRelease
 
4.执行以下命令新建文件10defaultRelease
 
<source lang="c">
 
<source lang="c">
 
sudo nano /etc/apt/apt.conf.d/10defaultRelease
 
sudo nano /etc/apt/apt.conf.d/10defaultRelease
</source>
+
</syntaxhighlight>
  
 
添加以下内容并保存
 
添加以下内容并保存
 
<source lang="c">
 
<source lang="c">
 
APT::Default-release \"stable";
 
APT::Default-release \"stable";
</source>
+
</syntaxhighlight>
  
 
5.执行以下命令新建文件libsdl
 
5.执行以下命令新建文件libsdl
 
<source lang="c">
 
<source lang="c">
 
sudo nano /etc/apt/preferences.d/libsdl
 
sudo nano /etc/apt/preferences.d/libsdl
</source>
+
</syntaxhighlight>
  
 
添加以下内容并保存
 
添加以下内容并保存
第60行: 第60行:
 
Pin: release n=wheezy
 
Pin: release n=wheezy
 
Pin-Priority: 900
 
Pin-Priority: 900
</source>
+
</syntaxhighlight>
  
 
6.执行以下命令
 
6.执行以下命令
第72行: 第72行:
 
sudo reboot
 
sudo reboot
 
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate
 
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate
</source>
+
</syntaxhighlight>
  
 
执行完上面6个步骤,Camera功能将可以正常使用。
 
执行完上面6个步骤,Camera功能将可以正常使用。

2019年11月14日 (四) 16:20的版本

搭配摄像头使用

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功能将可以正常使用。