more notes for a bad memory - - -
Using a Raspberry Pi Zero linked to my LAN to drive an 8x40 LED matrix
Scroll a message along the array to report greenhouse temperatures etc,
I could use an Arduino and an Ethernet board - but why bother when a Pi zero has so much spare power?
I connected 5 of these in line - they use MAX7219 driver chips - red only.
MAX7219 - Raspi
DIN(1) - MOSI (D11)
CLK(13) - SCK(D13)
LOAD(12) - SS(D10)
GROUND - GROUND
Take power for the display from the power source directly
I did not include 3.3 to 5 volt level shifters - it seems to work OK
Next time I would use a 4 in line strip that integrates 4 8x8 displays on one board.
And you can get them with the driver chip on the back - then build any x by y matrix.
SOFTWARE
This bash script will ping the Pi in the greenhouse that is generating the data that I want to display.
(I want to know that the displayed data is fresh)
The result goes into the PI Zero ramdisk for later use by the Blassic basic main program
#!/bin/bash # /home/graham/8x40LEDmatrix/pingtest.sh # -q quiet |
This bash script grabs the data that the greenhouse Pi stores in it's own ramdisk and puts it into the Pi Zero ramdisk
#!/bin/bash # /home/graham/8x40LEDmatrix/wget_pool_data.sh wget -O /var/www/html/ramdisk2/4b0_potpounds_latest.txt http://192.168.0.88:8888/ramdisk2/4b0_potpounds_latest.txt |
The python program, commandline.py, that accepts a text argument and scrolls it across the LED matrix
#!/usr/bin/env python |
This Blassic basic program does the following -
* ping the greenhouse Pi
* run the bash script that gets the data from the greenhouse Pi
* build a string to send to commandline.py to do the text scrolling
#!/usr/sbin/blassic ' /home/graham/8x40LEDmatrix/scroll_pool_data_fast.bas LABEL StartAgain SHELL "/home/graham/8x40LEDmatrix/pingtest.sh" LABEL PingOK OPEN "/var/www/html/ramdisk2/4b0_potpounds_latest.txt" FOR INPUT AS #1 : INPUT #1,potpounds$ : CLOSE #1 PRINT "potpounds$ = ",potpounds$ pipath$ = "/home/graham/MAX7219examples/rm-hull/commandline.py" pool$ = STR$(ROUND(VAL(pool$),1)) poolair$ = STR$(ROUND(VAL(poolair$),1)) i2c72temp$ = STR$(ROUND(VAL(i2c72temp$),1)) potpounds$ = STR$(ROUND(VAL(potpounds$),1)) 'message$ = message$ + " * Time $(date +'%d/%m %H:%M')" GOTO StartAgain LABEL PingFAIL GOTO StartAgain SYSTEM |
With thanks to rm-hull
Please email me if you want to swap notes