I recently implemented some code using a lookup table that should be exactly what you're looking for. You're on the right track as PROGMEM stores the table to your micro's flash instead of SRAM which is exactly what you need to do and is almost certainly what your friend was trying to say. I generated this table just using Excel to create the numeric columns and then a column between them with commas so that it pasted into code perfectly with no hand-writing of this really boring linear table.
To explain what I have below to help you make use of the example I'm doing some LED work where I need to quickly find a hue of the rainbow from a table instead of doing the expensive math formula or worse, depending on your other SRAM requirements, storing the table in SRAM. You'll see my table is essentially just a linear formula but saved me lots of SRAM and in my case, improved speed dramatically instead of math formulas to calculate the values.
First, make sure you include the necessary header file:
#include <avr/pgmspace.h> //used for PROGMEM
Then declare your table in your .pde:
//192 RGB values (576 bytes) in a linear fading formula in the form of R,G,B,R
prog_uchar tblRainbow[] PROGMEM = {
255 , 0 , 0 ,
251 , 4 , 0 ,
247 , 8 , 0 ,
243 , 12 , 0 ,
239 , 16 , 0 ,
235 , 20 , 0 ,
231 , 24 , 0 ,
227 , 28 , 0 ,
223 , 32 , 0 ,
219 , 36 , 0 ,
215 , 40 , 0 ,
211 , 44 , 0 ,
207 , 48 , 0 ,
203 , 52 , 0 ,
199 , 56 , 0 ,
195 , 60 , 0 ,
191 , 64 , 0 ,
187 , 68 , 0 ,
183 , 72 , 0 ,
179 , 76 , 0 ,
175 , 80 , 0 ,
171 , 84 , 0 ,
167 , 88 , 0 ,
163 , 92 , 0 ,
159 , 96 , 0 ,
155 , 100 , 0 ,
151 , 104 , 0 ,
147 , 108 , 0 ,
143 , 112 , 0 ,
139 , 116 , 0 ,
135 , 120 , 0 ,
131 , 124 , 0 ,
127 , 128 , 0 ,
123 , 132 , 0 ,
119 , 136 , 0 ,
115 , 140 , 0 ,
111 , 144 , 0 ,
107 , 148 , 0 ,
103 , 152 , 0 ,
99 , 156 , 0 ,
95 , 160 , 0 ,
91 , 164 , 0 ,
87 , 168 , 0 ,
83 , 172 , 0 ,
79 , 176 , 0 ,
75 , 180 , 0 ,
71 , 184 , 0 ,
67 , 188 , 0 ,
63 , 192 , 0 ,
59 , 196 , 0 ,
55 , 200 , 0 ,
51 , 204 , 0 ,
47 , 208 , 0 ,
43 , 212 , 0 ,
39 , 216 , 0 ,
35 , 220 , 0 ,
31 , 224 , 0 ,
27 , 228 , 0 ,
23 , 232 , 0 ,
19 , 236 , 0 ,
15 , 240 , 0 ,
11 , 244 , 0 ,
7 , 248 , 0 ,
3 , 252 , 0 ,
0 , 255 , 0 ,
0 , 251 , 4 ,
0 , 247 , 8 ,
0 , 243 , 12 ,
0 , 239 , 16 ,
0 , 235 , 20 ,
0 , 231 , 24 ,
0 , 227 , 28 ,
0 , 223 , 32 ,
0 , 219 , 36 ,
0 , 215 , 40 ,
0 , 211 , 44 ,
0 , 207 , 48 ,
0 , 203 , 52 ,
0 , 199 , 56 ,
0 , 195 , 60 ,
0 , 191 , 64 ,
0 , 187 , 68 ,
0 , 183 , 72 ,
0 , 179 , 76 ,
0 , 175 , 80 ,
0 , 171 , 84 ,
0 , 167 , 88 ,
0 , 163 , 92 ,
0 , 159 , 96 ,
0 , 155 , 100 ,
0 , 151 , 104 ,
0 , 147 , 108 ,
0 , 143 , 112 ,
0 , 139 , 116 ,
0 , 135 , 120 ,
0 , 131 , 124 ,
0 , 127 , 128 ,
0 , 123 , 132 ,
0 , 119 , 136 ,
0 , 115 , 140 ,
0 , 111 , 144 ,
0 , 107 , 148 ,
0 , 103 , 152 ,
0 , 99 , 156 ,
0 , 95 , 160 ,
0 , 91 , 164 ,
0 , 87 , 168 ,
0 , 83 , 172 ,
0 , 79 , 176 ,
0 , 75 , 180 ,
0 , 71 , 184 ,
0 , 67 , 188 ,
0 , 63 , 192 ,
0 , 59 , 196 ,
0 , 55 , 200 ,
0 , 51 , 204 ,
0 , 47 , 208 ,
0 , 43 , 212 ,
0 , 39 , 216 ,
0 , 35 , 220 ,
0 , 31 , 224 ,
0 , 27 , 228 ,
0 , 23 , 232 ,
0 , 19 , 236 ,
0 , 15 , 240 ,
0 , 11 , 244 ,
0 , 7 , 248 ,
0 , 3 , 252 ,
0 , 0 , 255 ,
4 , 0 , 251 ,
8 , 0 , 247 ,
12 , 0 , 243 ,
16 , 0 , 239 ,
20 , 0 , 235 ,
24 , 0 , 231 ,
28 , 0 , 227 ,
32 , 0 , 223 ,
36 , 0 , 219 ,
40 , 0 , 215 ,
44 , 0 , 211 ,
48 , 0 , 207 ,
52 , 0 , 203 ,
56 , 0 , 199 ,
60 , 0 , 195 ,
64 , 0 , 191 ,
68 , 0 , 187 ,
72 , 0 , 183 ,
76 , 0 , 179 ,
80 , 0 , 175 ,
84 , 0 , 171 ,
88 , 0 , 167 ,
92 , 0 , 163 ,
96 , 0 , 159 ,
100 , 0 , 155 ,
104 , 0 , 151 ,
108 , 0 , 147 ,
112 , 0 , 143 ,
116 , 0 , 139 ,
120 , 0 , 135 ,
124 , 0 , 131 ,
128 , 0 , 127 ,
132 , 0 , 123 ,
136 , 0 , 119 ,
140 , 0 , 115 ,
144 , 0 , 111 ,
148 , 0 , 107 ,
152 , 0 , 103 ,
156 , 0 , 99 ,
160 , 0 , 95 ,
164 , 0 , 91 ,
168 , 0 , 87 ,
172 , 0 , 83 ,
176 , 0 , 79 ,
180 , 0 , 75 ,
184 , 0 , 71 ,
188 , 0 , 67 ,
192 , 0 , 63 ,
196 , 0 , 59 ,
200 , 0 , 55 ,
204 , 0 , 51 ,
208 , 0 , 47 ,
212 , 0 , 43 ,
216 , 0 , 39 ,
220 , 0 , 35 ,
224 , 0 , 31 ,
228 , 0 , 27 ,
232 , 0 , 23 ,
236 , 0 , 19 ,
240 , 0 , 15 ,
244 , 0 , 11 ,
248 , 0 , 7 ,
252 , 0 , 3
};
Then write the small amount of extra code to retrieve the value from the table:
byte colorNum = 96;
pgm_read_byte_near(tblRainbow + (colorNum *3)),
pgm_read_byte_near(tblRainbow + (colorNum *3) +1),
pgm_read_byte_near(tblRainbow + (colorNum *3) +2)
When I want to pull out an RGB color (for example, color number 96, directly in the middle of the rainbow) I use the following code to pull bytes 288, 289, and 290 from the 576 byte table as shown above.
I hope that gives you a practical example of how to use a lookup table with PROGMEM. If you need more specific help, PM me and I'll look over your exact usage in more detail and tailor a better example/solution for you.