可选:HDMI输出,3.5mm视频输出,其它转接方式,以及官方显示屏
HDMI最方便,直接连接即可
用3.5mm视频输出可以连接CRT旧电视,接口集成在音频口,所以直接在音频口接耳机会发现底噪很大,不过社区正在改进这点
可以直接淘宝购买Zune的RCA Cable,或者DIY接口定义一致的线材,定义参考下图,图片版权归属原作者MATT:
另外需要修改 config.txt(PAL制式电视):
(新版的Jessie不用修改也能显示,如果没声音的话再进行以下操作)
树莓派上:
sudo nano /boot/config
或Windows上打开config.txt
将
sdtv_mode=2
前面的#删掉,变为:
sdtv_mode=2
配合老电视和 Xbox 360手柄或8位堂完全仿红白机的FC30手柄怀旧FC是相当不错的选择,系统方面可以选择Lakka ,RetroPie , recalbox-os
HDMI可以转接VGA,但多篇文章都建议一定用有源的HDMI转VGA,也就是可以连接电源的,否则会烧毁树莓派
修改config.txt文件,添加:
hdmi_force_hotplug=1hdmi_group=2hdmi_mode=16hdmi_drive=2
hdmi_mode=16为设置1024x768 60Hz 其它分辨率可参考官方config.txt说明
一些有源HDMI转VGA的选择:
白色款1,白色款2,黑色款1,黑色款2,Moto,(似乎这款最便宜,需要另外配一个Micro HDMI母对HDMI公,比如这个)
Lapdock 也可以连接Moto Lapdock(需要一个Micro HDMI转HDMI 母转公用作视频输出,比如这个,一个USB 2.0 A公对MICRO B母作数据传输(Lapdock的键盘及USB口设备),比如这个)或者NexDock当笔记本
Webtop
Lapdock
Lapdock
RPi
RPi
Micro HDMI female to HDMI male(Video)
Micro USB female to USB 2.0 male(Data)
如果用Moto Lapdock的话,可能发现没有声音,需要作以下改动:
sudo nano /boot/config.txt
找到:
hdmi_drive=2
去掉前面的‘#’使其生效
另外Lapdock的音量键需配置才能在Raspbian上使用
sudo nano ~/.config/openbox/lxde-pi-rc.xml
使用 CTRL + w 搜索 keyboard
定位到:
添加:
保存 CTRL + o 退出 CTRL + x
之后在Pi的终端内运行:
openbox --reconfigure
Nokia 5510/3310 LCD 这块屏幕的尺寸约1.5寸,分辨率为84x48,不论字体采用8x8还是6x12显示的内容都很有限,而且因为是拆机屏,质量难以保证 诺基亚5510/3310的液晶模块controller一般为PCD8544,接口为 SPI
然后通过:
gpio readall
查找树莓派上对应的端口,得到:
+-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+ | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM | +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+ | | | 3.3v | | | 1 || 2 | | | 5v | | | | 2 | 8 | SDA.1 | IN | 1 | 3 || 4 | | | 5V | | | | 3 | 9 | SCL.1 | IN | 1 | 5 || 6 | | | 0v | | | | 4 | 7 | GPIO. 7 | IN | 1 | 7 || 8 | 1 | ALT5 | TxD | 15 | 14 | | | | 0v | | | 9 || 10 | 1 | ALT5 | RxD | 16 | 15 | | 17 | 0 | GPIO. 0 | IN | 0 | 11 || 12 | 0 | IN | GPIO. 1 | 1 | 18 | | 27 | 2 | GPIO. 2 | IN | 0 | 13 || 14 | | | 0v | | | | 22 | 3 | GPIO. 3 | IN | 0 | 15 || 16 | 1 | OUT | GPIO. 4 | 4 | 23 | | | | 3.3v | | | 17 || 18 | 1 | OUT | GPIO. 5 | 5 | 24 | | 10 | 12 | MOSI | ALT0 | 0 | 19 || 20 | | | 0v | | | | 9 | 13 | MISO | ALT0 | 0 | 21 || 22 | 1 | OUT | GPIO. 6 | 6 | 25 | | 11 | 14 | SCLK | ALT0 | 0 | 23 || 24 | 1 | OUT | CE0 | 10 | 8 | | | | 0v | | | 25 || 26 | 1 | OUT | CE1 | 11 | 7 | | 0 | 30 | SDA.0 | IN | 1 | 27 || 28 | 1 | IN | SCL.0 | 31 | 1 | | 5 | 21 | GPIO.21 | IN | 1 | 29 || 30 | | | 0v | | | | 6 | 22 | GPIO.22 | IN | 1 | 31 || 32 | 0 | IN | GPIO.26 | 26 | 12 | | 13 | 23 | GPIO.23 | IN | 0 | 33 || 34 | | | 0v | | | | 19 | 24 | GPIO.24 | IN | 0 | 35 || 36 | 0 | IN | GPIO.27 | 27 | 16 | | 26 | 25 | GPIO.25 | IN | 0 | 37 || 38 | 0 | IN | GPIO.28 | 28 | 20 | | | | 0v | | | 39 || 40 | 0 | IN | GPIO.29 | 29 | 21 | +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+ | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM | +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
对照 BCM 及 Physical 栏,依次找到连线表内的对应端口
启用 SPI :
sudo nano /boot/config.txt
加入:
dtparam=spi=on
重启生效
这块单色LCD可以通过 FBTFT 进行console显示,这样在终端里能做的事用它都可以做到
由于Linux kernel staging tree已经加入FBTFT,所以不需额外安装
终端显示:
sudo modprobe fbtft_device name=nokia3310
dmesg 会显示:
......[ 52.092954] fbtft: module is from the staging directory, the quality is unknown, you have been warned.[ 52.098978] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.[ 52.101017] fbtft_device: SPI devices registered:[ 52.101040] fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00[ 52.101053] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00[ 52.101062] fbtft_device: 'fb' Platform devices registered:[ 52.101092] fbtft_device: soc:fb id=-1 pdata? no[ 52.101132] fbtft_device: Deleting spi0.0[ 52.101429] spi spi0.0: setting up native-CS0 as GPIO 8[ 52.101544] fbtft_device: GPIOS used by 'nokia3310':[ 52.101555] fbtft_device: 'reset' = GPIO25[ 52.101564] fbtft_device: 'dc' = GPIO24[ 52.101572] fbtft_device: 'led' = GPIO23[ 52.101580] fbtft_device: SPI devices registered:[ 52.101592] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00[ 52.101603] fbtft_device: fb_pcd8544 spi0.0 400kHz 8 bits mode=0x00[ 52.113572] fb_pcd8544: module is from the staging directory, the quality is unknown, you have been warned.[ 52.253490] graphics fb1: fb_pcd8544 frame buffer, 84x48, 7 KiB video memory, 0 KiB DMA buffer memory, fps=20, spi0.0 at 0 MHz
lsmod 会显示:
Module Size Used byfb_pcd8544 3048 0 fbtft_device 27354 0 fbtft 27484 2 fb_pcd8544,fbtft_devicesyscopyarea 2773 1 fbtftsysfillrect 3299 1 fbtftsysimgblt 1921 1 fbtftfb_sys_fops 1157 1 fbtft
启用终端:
con2fbmap 1 1
(如果遇到屏幕正面看是black screen,在别的角度可以看到文字的话,这和屏幕本身连接方式有关,其液晶与电路板是用导电胶连接的,可能没有充分接触,稍微压一下边框应该可以正常显示;如果LED闪得厉害,多半是屏幕有问题,建议找卖家换一个)