Skip to content

Commit 411060a

Browse files
committed
Add led matrix animated menu example
1 parent 4821aa4 commit 411060a

File tree

3 files changed

+465
-0
lines changed

3 files changed

+465
-0
lines changed
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This example depends on the ht1632c library which can be found at
2+
https://github.com/wildstray/ht1632c.
3+
4+
The patch in the folder with this example needs to be applied to the above
5+
library for it to work.
+241
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
diff --git a/font.h b/font.h
2+
index 52cff88..37c801a 100644
3+
--- a/font.h
4+
+++ b/font.h
5+
@@ -1,6 +1,6 @@
6+
#ifdef FONT_4x6
7+
// -Misc-Fixed-Medium-R-Normal--6-60-75-75-C-40-ISO10646-1
8+
-uint8_t PROGMEM font_4x6[95][4] = {
9+
+const uint8_t PROGMEM font_4x6[95][4] = {
10+
{0x00,0x00,0x00,0x00}, //
11+
{0x00,0x3a,0x00,0x00}, // !
12+
{0x30,0x00,0x30,0x00}, // "
13+
@@ -100,7 +100,7 @@ uint8_t PROGMEM font_4x6[95][4] = {
14+
#endif
15+
#ifdef FONT_5x7
16+
// -Misc-Fixed-Medium-R-Normal--7-70-75-75-C-50-ISO10646-1
17+
-uint8_t PROGMEM font_5x7[95][5] = {
18+
+const uint8_t PROGMEM font_5x7[95][5] = {
19+
{0x00,0x00,0x00,0x00,0x00}, //
20+
{0x00,0x00,0x7a,0x00,0x00}, // !
21+
{0x00,0x70,0x00,0x70,0x00}, // "
22+
@@ -200,7 +200,7 @@ uint8_t PROGMEM font_5x7[95][5] = {
23+
#endif
24+
#ifdef FONT_5x8
25+
// -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO10646-1
26+
-uint8_t PROGMEM font_5x8[95][5] = {
27+
+const uint8_t PROGMEM font_5x8[95][5] = {
28+
{0x00,0x00,0x00,0x00,0x00}, //
29+
{0x00,0x00,0x7a,0x00,0x00}, // !
30+
{0x00,0x70,0x00,0x70,0x00}, // "
31+
@@ -299,7 +299,7 @@ uint8_t PROGMEM font_5x8[95][5] = {
32+
};
33+
#endif
34+
#ifdef FONT_5x7W
35+
-uint8_t PROGMEM font_5x7w[95][5] = {
36+
+const uint8_t PROGMEM font_5x7w[95][5] = {
37+
{0x00,0x00,0x00,0x00,0x00}, //
38+
{0x00,0x00,0xfa,0x00,0x00}, // !
39+
{0x00,0xe0,0x00,0xe0,0x00}, // "
40+
@@ -398,7 +398,7 @@ uint8_t PROGMEM font_5x7w[95][5] = {
41+
};
42+
#endif
43+
#ifdef FONT_8x8
44+
-uint8_t PROGMEM font_8x8[95][8] = {
45+
+const uint8_t PROGMEM font_8x8[95][8] = {
46+
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, //
47+
{0x00,0x60,0xfa,0xfa,0x60,0x00,0x00,0x00}, // !
48+
{0x00,0xe0,0xe0,0x00,0xe0,0xe0,0x00,0x00}, // "
49+
@@ -498,7 +498,7 @@ uint8_t PROGMEM font_8x8[95][8] = {
50+
#endif
51+
#ifdef FONT_6x10
52+
// -Misc-Fixed-Medium-R-Normal--10-100-75-75-C-60-ISO10646-1
53+
-uint16_t PROGMEM font_6x10[95][6] = {
54+
+const uint16_t PROGMEM font_6x10[95][6] = {
55+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
56+
{0x0000,0x0000,0x01f4,0x0000,0x0000,0x0000}, // !
57+
{0x0000,0x01c0,0x0000,0x01c0,0x0000,0x0000}, // "
58+
@@ -598,7 +598,7 @@ uint16_t PROGMEM font_6x10[95][6] = {
59+
#endif
60+
#ifdef FONT_6x12
61+
// -Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1
62+
-uint16_t PROGMEM font_6x12[95][6] = {
63+
+const uint16_t PROGMEM font_6x12[95][6] = {
64+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
65+
{0x0000,0x0000,0x01f4,0x0000,0x0000,0x0000}, // !
66+
{0x0000,0x0380,0x0000,0x0380,0x0000,0x0000}, // "
67+
@@ -698,7 +698,7 @@ uint16_t PROGMEM font_6x12[95][6] = {
68+
#endif
69+
#ifdef FONT_6x13
70+
// -Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1
71+
-uint16_t PROGMEM font_6x13[95][6] = {
72+
+const uint16_t PROGMEM font_6x13[95][6] = {
73+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
74+
{0x0000,0x0000,0x07f4,0x0000,0x0000,0x0000}, // !
75+
{0x0000,0x0700,0x0000,0x0700,0x0000,0x0000}, // "
76+
@@ -798,7 +798,7 @@ uint16_t PROGMEM font_6x13[95][6] = {
77+
#endif
78+
#ifdef FONT_6x13B
79+
// -Misc-Fixed-Bold-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1
80+
-uint16_t PROGMEM font_6x13B[95][6] = {
81+
+const uint16_t PROGMEM font_6x13B[95][6] = {
82+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
83+
{0x0000,0x0000,0x07f4,0x07f4,0x0000,0x0000}, // !
84+
{0x0700,0x0700,0x0000,0x0700,0x0700,0x0000}, // "
85+
@@ -898,7 +898,7 @@ uint16_t PROGMEM font_6x13B[95][6] = {
86+
#endif
87+
#ifdef FONT_6x13O
88+
// -Misc-Fixed-Medium-O-SemiCondensed--13-120-75-75-C-60-ISO10646-1
89+
-uint16_t PROGMEM font_6x13O[95][6] = {
90+
+const uint16_t PROGMEM font_6x13O[95][6] = {
91+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
92+
{0x0000,0x0000,0x0074,0x0780,0x0000,0x0000}, // !
93+
{0x0000,0x0000,0x0100,0x0600,0x0100,0x0600}, // "
94+
@@ -998,7 +998,7 @@ uint16_t PROGMEM font_6x13O[95][6] = {
95+
#endif
96+
#ifdef FONT_6x9
97+
// -Misc-Fixed-Medium-R-Normal--9-90-75-75-C-60-ISO10646-1
98+
-uint16_t PROGMEM font_6x9[95][6] = {
99+
+const uint16_t PROGMEM font_6x9[95][6] = {
100+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
101+
{0x0000,0x0000,0x00f4,0x0000,0x0000,0x0000}, // !
102+
{0x0000,0x00e0,0x0000,0x00e0,0x0000,0x0000}, // "
103+
@@ -1098,7 +1098,7 @@ uint16_t PROGMEM font_6x9[95][6] = {
104+
#endif
105+
#ifdef FONT_7x13
106+
// -Misc-Fixed-Medium-R-Normal--13-120-75-75-C-70-ISO10646-1
107+
-uint16_t PROGMEM font_7x13[95][7] = {
108+
+const uint16_t PROGMEM font_7x13[95][7] = {
109+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
110+
{0x0000,0x0000,0x0000,0x07f4,0x0000,0x0000,0x0000}, // !
111+
{0x0000,0x0000,0x0700,0x0000,0x0700,0x0000,0x0000}, // "
112+
@@ -1198,7 +1198,7 @@ uint16_t PROGMEM font_7x13[95][7] = {
113+
#endif
114+
#ifdef FONT_7x13B
115+
// -Misc-Fixed-Bold-R-Normal--13-120-75-75-C-70-ISO10646-1
116+
-uint16_t PROGMEM font_7x13B[95][7] = {
117+
+const uint16_t PROGMEM font_7x13B[95][7] = {
118+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
119+
{0x0000,0x0000,0x07ec,0x07ec,0x0000,0x0000,0x0000}, // !
120+
{0x0000,0x0700,0x0700,0x0000,0x0700,0x0700,0x0000}, // "
121+
@@ -1298,7 +1298,7 @@ uint16_t PROGMEM font_7x13B[95][7] = {
122+
#endif
123+
#ifdef FONT_7x13O
124+
// -Misc-Fixed-Medium-O-Normal--13-120-75-75-C-70-ISO10646-1
125+
-uint16_t PROGMEM font_7x13O[95][7] = {
126+
+const uint16_t PROGMEM font_7x13O[95][7] = {
127+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
128+
{0x0000,0x0000,0x0074,0x0780,0x0000,0x0000,0x0000}, // !
129+
{0x0000,0x0000,0x0700,0x0000,0x0700,0x0000,0x0000}, // "
130+
@@ -1398,7 +1398,7 @@ uint16_t PROGMEM font_7x13O[95][7] = {
131+
#endif
132+
#ifdef FONT_7x14
133+
// -Misc-Fixed-Medium-R-Normal--14-130-75-75-C-70-ISO10646-1
134+
-uint16_t PROGMEM font_7x14[95][7] = {
135+
+const uint16_t PROGMEM font_7x14[95][7] = {
136+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
137+
{0x0000,0x0000,0x0000,0x0fec,0x0000,0x0000,0x0000}, // !
138+
{0x0000,0x0000,0x1e00,0x0000,0x1e00,0x0000,0x0000}, // "
139+
@@ -1498,7 +1498,7 @@ uint16_t PROGMEM font_7x14[95][7] = {
140+
#endif
141+
#ifdef FONT_7x14B
142+
// -Misc-Fixed-Bold-R-Normal--14-130-75-75-C-70-ISO10646-1
143+
-uint16_t PROGMEM font_7x14B[95][7] = {
144+
+const uint16_t PROGMEM font_7x14B[95][7] = {
145+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
146+
{0x0000,0x0000,0x0fec,0x0fec,0x0000,0x0000,0x0000}, // !
147+
{0x0000,0x1e00,0x1e00,0x0000,0x1e00,0x1e00,0x0000}, // "
148+
@@ -1598,7 +1598,7 @@ uint16_t PROGMEM font_7x14B[95][7] = {
149+
#endif
150+
#ifdef FONT_8x13
151+
// -Misc-Fixed-Medium-R-Normal--13-120-75-75-C-80-ISO10646-1
152+
-uint16_t PROGMEM font_8x13[95][8] = {
153+
+const uint16_t PROGMEM font_8x13[95][8] = {
154+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
155+
{0x0000,0x0000,0x0000,0x07f4,0x0000,0x0000,0x0000,0x0000}, // !
156+
{0x0000,0x0000,0x0700,0x0000,0x0000,0x0700,0x0000,0x0000}, // "
157+
@@ -1698,7 +1698,7 @@ uint16_t PROGMEM font_8x13[95][8] = {
158+
#endif
159+
#ifdef FONT_8x13B
160+
// -Misc-Fixed-Bold-R-Normal--13-120-75-75-C-80-ISO10646-1
161+
-uint16_t PROGMEM font_8x13B[95][8] = {
162+
+const uint16_t PROGMEM font_8x13B[95][8] = {
163+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
164+
{0x0000,0x0000,0x0000,0x0fec,0x0fec,0x0000,0x0000,0x0000}, // !
165+
{0x0000,0x0f00,0x0f00,0x0000,0x0f00,0x0f00,0x0000,0x0000}, // "
166+
@@ -1798,7 +1798,7 @@ uint16_t PROGMEM font_8x13B[95][8] = {
167+
#endif
168+
#ifdef FONT_8x13O
169+
// -Misc-Fixed-Medium-O-Normal--13-120-75-75-C-80-ISO10646-1
170+
-uint16_t PROGMEM font_8x13O[95][8] = {
171+
+const uint16_t PROGMEM font_8x13O[95][8] = {
172+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
173+
{0x0000,0x0000,0x0000,0x0074,0x0780,0x0000,0x0000,0x0000}, // !
174+
{0x0000,0x0000,0x0700,0x0000,0x0000,0x0700,0x0000,0x0000}, // "
175+
@@ -1898,7 +1898,7 @@ uint16_t PROGMEM font_8x13O[95][8] = {
176+
#endif
177+
#ifdef FONT_9x15
178+
// -Misc-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO10646-1
179+
-uint16_t PROGMEM font_9x15[95][9] = {
180+
+const uint16_t PROGMEM font_9x15[95][9] = {
181+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
182+
{0x0000,0x0000,0x0000,0x0000,0x3f98,0x0000,0x0000,0x0000,0x0000}, // !
183+
{0x0000,0x0000,0x0000,0x1c00,0x0000,0x0000,0x1c00,0x0000,0x0000}, // "
184+
@@ -1998,7 +1998,7 @@ uint16_t PROGMEM font_9x15[95][9] = {
185+
#endif
186+
#ifdef FONT_9x15B
187+
// -Misc-Fixed-Bold-R-Normal--15-140-75-75-C-90-ISO10646-1
188+
-uint16_t PROGMEM font_9x15b[95][9] = {
189+
+const uint16_t PROGMEM font_9x15b[95][9] = {
190+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
191+
{0x0000,0x0000,0x0000,0x1fe8,0x1fe8,0x0000,0x0000,0x0000,0x0000}, // !
192+
{0x0000,0x0000,0x1c00,0x1c00,0x0000,0x1c00,0x1c00,0x0000,0x0000}, // "
193+
@@ -2098,7 +2098,7 @@ uint16_t PROGMEM font_9x15b[95][9] = {
194+
#endif
195+
#ifdef FONT_8x16
196+
// -Sony-Fixed-Medium-R-Normal--16-120-100-100-C-80-ISO8859-1
197+
-uint16_t PROGMEM font_8x16[95][8] = {
198+
+const uint16_t PROGMEM font_8x16[95][8] = {
199+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
200+
{0x0000,0x0000,0x7e02,0x7fe7,0x7e02,0x0000,0x0000,0x0000}, // !
201+
{0x0000,0xc800,0xf000,0x0000,0xc800,0xf000,0x0000,0x0000}, // "
202+
@@ -2197,7 +2197,7 @@ uint16_t PROGMEM font_8x16[95][8] = {
203+
};
204+
#endif
205+
#ifdef FONT_8x16B
206+
-uint16_t PROGMEM font_8x16b[95][8] = {
207+
+const uint16_t PROGMEM font_8x16b[95][8] = {
208+
{0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}, //
209+
{0x0000,0x0000,0x7e02,0x7fe7,0x7fe7,0x7e02,0x0000,0x0000}, // !
210+
{0x0000,0xc800,0xf800,0xf000,0x0800,0xf800,0xf000,0x0000}, // "
211+
diff --git a/ht1632c.cpp b/ht1632c.cpp
212+
index f78aa15..3097cf8 100644
213+
--- a/ht1632c.cpp
214+
+++ b/ht1632c.cpp
215+
@@ -3,7 +3,7 @@
216+
#include <string.h>
217+
#include "ht1632c.h"
218+
#include "Print.h"
219+
-#include "font_b.h"
220+
+#include "font.h"
221+
#include "font_koi8.h"
222+
223+
/* fast integer (1 uint8_t) modulus - returns n % d */
224+
diff --git a/ht1632c.h b/ht1632c.h
225+
index bd18a7b..eb024ff 100644
226+
--- a/ht1632c.h
227+
+++ b/ht1632c.h
228+
@@ -24,11 +24,11 @@
229+
230+
/* Leaflab Maple specific definitions */
231+
232+
+typedef unsigned char prog_uint8_t;
233+
+typedef unsigned int prog_uint16_t;
234+
#if defined (__ARMEL__)
235+
typedef unsigned char uint8_t;
236+
typedef unsigned int uint16_t;
237+
-typedef unsigned char prog_uint8_t;
238+
-typedef unsigned int prog_uint16_t;
239+
uint8_t inline pgm_read_byte_near(uint8_t *ptr) { return (uint8_t)*ptr; }
240+
uint16_t inline pgm_read_word_near(uint16_t *ptr) { return (uint16_t)*ptr; }
241+
#define PROGMEM __FLASH__

0 commit comments

Comments
 (0)