Skip to content

Commit 8fd5b8f

Browse files
authored
Merge pull request #2153 from PaintYourDragon/pi-matrix-cube
Add Pi_Matrix_Cube initial files
2 parents 5587b67 + 9510829 commit 8fd5b8f

File tree

12 files changed

+2118
-0
lines changed

12 files changed

+2118
-0
lines changed

Pi_Matrix_Cube/Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
RGB_LIB_DISTRIBUTION=../rpi-rgb-led-matrix
2+
RGB_INCDIR=$(RGB_LIB_DISTRIBUTION)/include
3+
RGB_LIBDIR=$(RGB_LIB_DISTRIBUTION)/lib
4+
RGB_LIBRARY_NAME=rgbmatrix
5+
CXXFLAGS=-Wall -Ofast -fomit-frame-pointer -I$(RGB_INCDIR)
6+
LDFLAGS+=-L$(RGB_LIBDIR) -l$(RGB_LIBRARY_NAME) -lrt -lm -lpthread
7+
8+
EXECS = globe life
9+
10+
all: $(EXECS)
11+
12+
globe: globe.cc
13+
$(CXX) $(CXXFLAGS) $< -o $@ $(LDFLAGS) -ljpeg
14+
strip $@
15+
16+
life: life.cc
17+
$(CXX) $(CXXFLAGS) $< -o $@ $(LDFLAGS)
18+
strip $@
19+
20+
clean:
21+
rm -f $(EXECS)

Pi_Matrix_Cube/cycle.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
3+
# Fades/cycles the globe program through different scenes
4+
5+
# Show all files in the maps directory in alphabetical order
6+
FILES=maps/*.jpg
7+
# If you'd prefer a subset of files, different order or location,
8+
# you can instead make a list of filenames, e.g.:
9+
# FILES="
10+
# maps/earth.jpg
11+
# maps/moon.jpg
12+
# maps/jupiter.jpg
13+
# "
14+
15+
# Flags passed to globe program each time.
16+
# --led-pwm-bits=9 because long chain is otherwise flickery (default is 11)
17+
# -a 3 for 3x3 antialiasing (use 2 or 1 for slower Pi)
18+
# -r 6 is run time in seconds before exiting
19+
# -f 1 fades in/out for 1 second at either end
20+
# Can add "-p" to this list if you want poles at cube vertices,
21+
# or --led-rgb-sequence="BRG" with certain RGB matrices, etc.
22+
set -- --led-pwm-bits=9 -a 3 -r 6 -f 1
23+
24+
while true; do
25+
for f in $FILES; do
26+
./globe $@ -i $f
27+
done
28+
done

0 commit comments

Comments
 (0)