一星期前,淘到块32*64 RGB点阵显示屏,回来,马上接stm32试了下,没有坏点。全部点亮,是1/16扫描,也就是说是标准接口
接口特写:
0x02:驱动 得益于强大的树莓派社区,发现个rgb点阵项目。直接拿来用不错:https://github.com/hzeller/rpi-rgb-led-matrix
项目是支持RPI B / B+ / 2B 的,所以提供了3种接线方法。实际我接线是采用 “[1]” 的接线方法只用到前26个gpio 为嘛不采用2 或3的接线方法呢,是因为我没有40pin的PI ,只有个B 。 0x03:运行 - wget https://github.com/hzeller/rpi-rgb-led-matrix/archive/master.zip
复制代码解压缩:
- unzip master.zipcd rpi-rgb-led-matrix-master/
复制代码 进入目录:- cd rpi-rgb-led-matrix-master/
复制代码 编译:运行: 会弹出如下提示: - usage: ./led-matrix <options> -D <demo-nr> [optional parameter]Options:
- -r <rows> : Display rows. 16 for 16x32, 32 for 32x32. Default: 32
- -c <chained> : Daisy-chained boards. Default: 1.
- -L : 'Large' display, composed out of 4 times 32x32
- -p <pwm-bits> : Bits used for PWM. Something between 1..7
- -g : Do gamma correction (experimental)
- -D <demo-nr> : Always needs to be set
- -d : run as daemon. Use this when starting in
- /etc/init.d, but also when running without
- terminal (e.g. cron).
- -t <seconds> : Run for these number of seconds, then exit.
- (if neither -d nor -t are supplied, waits for <RETURN>)
- Demos, choosen with -D
- 0 - some rotating square
- 1 - forward scrolling an image (-m <scroll-ms>)
- 2 - backward scrolling an image (-m <scroll-ms>)
- 3 - test image: a square
- 4 - Pulsing color
- Example:
- ./led-matrix -t 10 -D 1 runtext.ppm
- Scrolls the runtext for 10 seconds
复制代码运行测试demo: - sudo ./led-matrix -d -r 32 -c 2 -t 20 -D 1 runtext.ppm #-d 会后台运行,-t 运行时间 -r 32 -c 2 指定是32*64点阵显示
复制代码- (while :; do date +%T ; sleep 0.5 ; done) | sudo ./text-example -f fonts/8x13B.bdf -y8 -c2 -C 255,255,255
复制代码之后嘿嘿就可以看到rgb 点阵屏上显示信息:(滚动显示ppm图片内容,懒得弄gif 了假装图片会动)
显示字符demo: - (while :; do date +%T ; sleep 0.5 ; done) | sudo ./text-example -f fonts/8x13B.bdf -y8 -c2 -C 255,255,255<p style="line-height: 28px;"></p>
复制代码
实际上更有意思的是显示图片玩 - sudo aptitude install libgraphicsmagick++-dev libwebp-dev
复制代码
效果嘛如下:
参考文献:
https://github.com/hzeller/rpi-rgb-led-matrix
|