LED screen driver build for hackspace.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "ledScreen.h"
00003 
00004 LocalFileSystem local("local");
00005 
00006 // screen instance
00007 ledScreen screen;
00008 
00009 // sin lookup table and related functions
00010 unsigned char sinlut[256];
00011 
00012 void initSinLut() {
00013     for (int i=0; i<256; i++)
00014         sinlut[i] = cos((float)i / 256.0 * (3.14159265 * 2))*127 + 128;
00015 }
00016 
00017 inline unsigned char lut_sin(int x) {
00018 
00019     return (x>0)?sinlut[x%256]:sinlut[(-x)%256];
00020 }
00021 
00022 
00023 // Example frame makes:
00024 
00025 
00026 //rainbow
00027 void makeFrame1(unsigned char* data) {
00028 
00029     static int time=0;
00030     time++;
00031 
00032     // override data with a intensity gradient test pattern
00033     for (int x=0; x<3*16; x++) {
00034         for (int y=0; y<16; y++) {
00035 
00036             int i = (x + y*(16*3)) * 3;  // figure out the memory location
00037 
00038             data[i] = lut_sin(x*255/48+(time/2)%256+y); //(sin((float)(x+time)/15.0)+1.0)*128 ;   // red
00039             data[i+1] = lut_sin(x*255/48+(time/2)%256 + 85+y); //(sin((float)(x+time)/15.0)+1.0)*128 ;   // red
00040             data[i+2] = lut_sin(x*255/48+(time/2)%256 +170+y); //(sin((float)(x+time)/15.0)+1.0)*128 ;   // red
00041         }
00042     }
00043 
00044 }
00045 
00046 // static gradients
00047 void makeFrame3(unsigned char* data) {
00048 
00049     static int time=0;
00050     time++;
00051 
00052     // override data with a intensity gradient test pattern
00053     for (int x=0; x<3*16; x++) {
00054         for (int y=0; y<16; y++) {
00055 
00056             int i = (x + y*(16*3)) * 3;  // figure out the memory location
00057 
00058             data[i] = x*256/48; //(sin((float)(x+time)/15.0)+1.0)*128 ;   // red
00059             data[i+1] = 0;  // green
00060             data[i+2] = y*256/16; //(i/3)%256 ; // blue
00061         }
00062     }
00063 
00064 }
00065 
00066 // wavy animation
00067 void makeFrame4(unsigned char* data) {
00068 
00069     static int time=0;
00070     time++;
00071 
00072     // override data with a intensity gradient test pattern
00073     for (int x=0; x<3*16; x++) {
00074         for (int y=0; y<16; y++) {
00075 
00076             int i = (x%16 + y*16 + (x/16)*256) * 3;  // figure out the memory location
00077 
00078             data[i] = lut_sin(time*15/16 - x*32 + y*32);
00079             data[i+1] = 0;
00080             data[i+2] = lut_sin((((x-24)*(x-24) + (y-8)*(y-8)) - time/1));
00081         }
00082     }
00083 
00084 }
00085 
00086 // stars + smoothed (convolved) travelling comet
00087 void makeFrame7(unsigned char* data) {
00088 
00089     static int time=0;
00090     
00091     //stars
00092     data[rand()%(3*16*16*3)] = 255;
00093 
00094     //increment time
00095     time++;
00096 
00097     //Do convolution
00098     for (int x=1; x<47; x++) { // ignore first and last column
00099         for (int y=1; y<15; y++) {
00100             if (time%2) {
00101                 data[x*3+y*3*48] = ((data[x*3+y*3*48]*30)/32 + (data[(x+1)*3+y*3*48]*1)/32 + (data[(x-1)*3+y*3*48]*1)/32);
00102                 data[x*3+y*3*48 +1] = ((data[x*3+y*3*48 +1]*30)/32 + (data[(x+1)*3+y*3*48 +1]*1)/32 + (data[(x-1)*3+y*3*48 +1]*1)/32);
00103                 data[x*3+y*3*48 +2] = ((data[x*3+y*3*48 +2]*30)/32 + (data[(x+1)*3+y*3*48 +2]*1)/32 + (data[(x-1)*3+y*3*48 +2]*1)/32);
00104             } else {
00105                 data[x*3+y*3*48] = ((data[x*3+y*3*48]*30)/32 + (data[(x)*3+(y+1)*3*48]*1)/32 + (data[(x)*3+(y-1)*3*48]*1)/32);
00106                 data[x*3+y*3*48 +1] = ((data[x*3+y*3*48 +1]*30)/32 + (data[(x)*3+(y+1)*3*48 +1]*1)/32 + (data[(x)*3+(y-1)*3*48 +1]*1)/32);
00107                 data[x*3+y*3*48 +2] = ((data[x*3+y*3*48 +2]*30)/32 + (data[(x)*3+(y+1)*3*48 +2]*1)/32 + (data[(x)*3+(y-1)*3*48 +2]*1)/32);
00108             }
00109 
00110         }
00111     }
00112 
00113     // handle the border
00114     for (int y=0; y<16; y++) {
00115         if (time%2) {
00116             int x=0;
00117             data[x*3+y*3*48] = (data[x*3+y*3*48]*30)/32 + (data[(x+1)*3+y*3*48]*1)/32 ;
00118             data[x*3+y*3*48 +1] = (data[x*3+y*3*48 +1]*30)/32 + (data[(x+1)*3+y*3*48 +1]*1)/32 ;
00119             data[x*3+y*3*48 +2] = (data[x*3+y*3*48 +2]*30)/32 + (data[(x+1)*3+y*3*48 +2]*1)/32 ;
00120 
00121             x=47;
00122             data[x*3+y*3*48] = ((data[x*3+y*3*48]*30)/32  + (data[(x-1)*3+y*3*48]*1)/32);
00123             data[x*3+y*3*48 +1] = ((data[x*3+y*3*48 +1]*30)/32 + (data[(x-1)*3+y*3*48 +1]*1)/32);
00124             data[x*3+y*3*48 +2] = ((data[x*3+y*3*48 +2]*30)/32 + (data[(x-1)*3+y*3*48 +2]*1)/32);
00125         }
00126     }
00127 
00128     for (int x=0; x<48; x++) { 
00129         if (!(time%2)) {
00130             int y=0;
00131             data[x*3+y*3*48] = ((data[x*3+y*3*48]*30)/32 + (data[(x)*3+(y+1)*3*48]*1)/32);
00132             data[x*3+y*3*48 +1] = ((data[x*3+y*3*48 +1]*30)/32 + (data[(x)*3+(y+1)*3*48 +1]*1)/32);
00133             data[x*3+y*3*48 +2] = ((data[x*3+y*3*48 +2]*30)/32 + (data[(x)*3+(y+1)*3*48 +2]*1)/32);
00134 
00135             y=15;
00136             data[x*3+y*3*48] = ((data[x*3+y*3*48]*30)/32 + (data[(x)*3+(y-1)*3*48]*1)/32);
00137             data[x*3+y*3*48 +1] = ((data[x*3+y*3*48 +1]*30)/32 + (data[(x)*3+(y-1)*3*48 +1]*1)/32);
00138             data[x*3+y*3*48 +2] = ((data[x*3+y*3*48 +2]*30)/32 + (data[(x)*3+(y-1)*3*48 +2]*1)/32);
00139 
00140         }
00141     }
00142 
00143     // determine current comet location
00144     int ballx = (8 + sin((float)time/25)*4+sin((float)time/17)*3+sin((float)time/13)*2)*3;
00145     int bally =  8 + sin((float)time/12)*4+sin((float)time/15)*3+sin((float)time/14)*2;
00146 
00147     unsigned char r = lut_sin(time);
00148     unsigned char g = lut_sin(time*15/16);
00149     unsigned char b = lut_sin(time*17/16);
00150 
00151     // saturate brightness to a certain level
00152     while ((int)r+g+b<255) {
00153         r++;
00154         g++;
00155         b++;
00156     };
00157 
00158     // write the circle of the comet to the buffer
00159     for (int x=-2; x<=2; x++) {
00160         for (int y=-2; y<=2; y++) {
00161             if (x*x + y*y<1.5 ) { 
00162                 if (x+ballx<16*3 && x+ballx>=0 && y+bally<16 && y+bally>=0) {
00163                     int i = (x+ballx)*3 + (y+bally)*3*48;
00164 
00165                     data[i] = r;
00166                     data[i+1] = g;
00167                     data[i+2] = b;
00168                 }
00169             }
00170         }
00171     }
00172 }
00173 
00174 struct charsz{
00175     unsigned char width;
00176     unsigned int data;
00177     
00178     charsz() {
00179         width=0;
00180     }
00181     
00182     charsz(char c) {
00183         width=0;
00184       
00185     }
00186     bool get(int x, int y)
00187     {
00188         return data & (1 << (y * 5 + x));
00189     }
00190 };
00191 
00192 
00193 #define _C(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y) \
00194         ((a) | (b << 1) | (c << 2) | (d << 3) | (e << 4) | \
00195         (f << 5) | (g << 6) | (h << 7) | (i << 8) | (j << 9) | \
00196         (k << 10) | (l << 11) | (m << 12) | (n << 13) | (o << 14) | \
00197         (p << 15) | (q << 16) | (r << 17) | (s << 18) | (t << 19) | \
00198         (u << 20) | (v << 21) | (w << 22) | (x << 23) | (y << 24))
00199     
00200 
00201 
00202 static charsz numbers[128];
00203 
00204 
00205 int charToScreen(int xco,int yco, char d, unsigned char *data, unsigned int colour)
00206 { 
00207     
00208     for(int x=0; x<numbers[d].width; x++)
00209         for(int y=0; y<5; y++)
00210             for(unsigned int col = 0; col < 3; ++col)
00211                 //data[3 * ((x+xco) + (y+yco) * 48) + col] = numbers[d].get(x,y) ? ((colour & (0xFF << ((2-col)*8))) >> ((2-col)*8) ) : 0;
00212                 if (numbers[d].get(x,y) && xco+x<48 && x+xco >= 0)
00213                     data[3 * ((x+xco) + (y+yco) * 48) + col] = ((colour & (0xFF << ((2-col)*8))) >> ((2-col)*8) );
00214                 
00215     return numbers[d].width;
00216     
00217     
00218 
00219 }
00220 
00221 void printString(const char *s, float xco, int yco, unsigned char *data, unsigned int col)
00222 {
00223     unsigned int len = strlen(s);
00224     for (int d=0; d < len; ++d)
00225     {
00226         if(xco >= -numbers[s[d]].width && xco < 48)
00227             charToScreen(xco,yco,s[d],data,col);
00228             
00229         xco += numbers[s[d]].width + 1;
00230     }
00231 }
00232 
00233 void fadeFrame(unsigned char* data, float amount)
00234     {
00235         for (int x = 0; x < 48; x++)
00236             for (int y = 0; y < 16; y++)
00237             {
00238                 data[x*3+y*3*48]-=amount;
00239                 data[x*3+y*3*48+1]-=amount;
00240                 data[x*3+y*3*48+2]-=amount;
00241             }
00242     }
00243 
00244 // Scroll text
00245 class scrollingText {
00246 public:
00247     const char *s;
00248     int xco;
00249     int yco;
00250     unsigned char *data;
00251     unsigned int col;
00252     float scroller;
00253     float scrollspeed;
00254     
00255     scrollingText(const char *sp, int xcop, int ycop, unsigned char *datap, unsigned int colp, float scrollspeedp)
00256         : s(sp), xco(xcop), yco(ycop), data(datap), col(colp), scroller(0), scrollspeed(scrollspeedp) {}
00257         
00258     void update()
00259     {
00260         //printString(s, xco+(int)scroller, yco, data, col);
00261         printString(s, xco+scroller, yco, data, col);
00262         unsigned int len = strlen(s);
00263         int actualStringLength = len+1;
00264         for (int d=0; d < len; ++d) { actualStringLength += numbers[d].width; }
00265         if ((int)scroller+xco < -actualStringLength) { scroller=48-xco; }
00266         
00267         scroller-=scrollspeed;
00268     }
00269 };
00270 
00271 // Binary counter timer
00272 Timer t;
00273 // Read file counter
00274 Timer s;
00275 
00276 char *txt = NULL;
00277 
00278 void makeFrame9(unsigned char* data) {
00279     fadeFrame(data, 255);
00280     
00281     /*
00282     //0 screen
00283     for(unsigned int x = 0; x < 48; ++x)
00284         for(unsigned int y = 0; y < 16; ++y)
00285             for(unsigned int col = 0; col < 3; ++col)
00286                 data[3 * ((x) + y * 48) + col] = 0;
00287     */
00288 
00289     time_t seconds = time(NULL);
00290         
00291     //uptime! 
00292     static scrollingText uptimeText(txt, 4, 1, data, 0xFF0000, 0.1);
00293     
00294     uptimeText.update();
00295     
00296     
00297     
00298     int yoff=6;
00299     unsigned int startX = 7;
00300     for(unsigned int x = 0; x < 32; ++x)
00301         for(unsigned int y = 0; y < 4; ++y)
00302             for(unsigned int col = 0; col < 3; ++col)
00303                 //data[3 * ((x+startX) + (y+yoff) * 48) + col] = (col == 0 ? ((seconds & (1 << (31-x))) ? 255 : 0) : 0);
00304                 if(((int)(t.read()*50) & (1 << (31-x))) && col == 0)
00305                     data[3 * ((x+startX) + (y+yoff) * 48) + col] = 255;
00306 
00307     int day = (seconds/(3600*24))%10;
00308     int hour = (seconds/3600)%24;
00309     int min = (seconds/60)%60;
00310     int sec = (seconds)%60;
00311    
00312     
00313     char digits[11] = {day+'0',':', (hour/10)+'0', hour%10+'0', ':', min/10+'0', min%10+'0', ':', sec/10+'0', sec%10+'0', 0};
00314     
00315     
00316     printString(digits, 4, 10, data, 0x0000FF);
00317     
00318 }     
00319 
00320 
00321 void readTextFromMBed()
00322 {
00323     //txt = "test";
00324     
00325     
00326     //stringy
00327     FILE *set = fopen("/local/scroller.txt", "r");  // Open "scroller.txt" on the local file system for read
00328     if(set)
00329     {
00330         fseek(set, 0L, SEEK_END);
00331         int sz = ftell(set);
00332         fseek(set, 0L, SEEK_SET);
00333         
00334         if(txt)
00335             free(txt);
00336         
00337         txt = (char *) malloc(sz);
00338         
00339         fread(txt, sz, sz, set);
00340         
00341         fclose(set);
00342     }
00343     else
00344     {
00345         txt = "File not found";
00346     }
00347 }    
00348 
00349 
00350 
00351 void initCharArray();
00352 
00353  
00354 int main()
00355 {
00356 
00357     initCharArray();
00358     readTextFromMBed();
00359     set_time(0); 
00360     
00361     s.reset();
00362     t.start();
00363 
00364     int time=0; // optional
00365     int frametype=1; // optional
00366 
00367     // framebuffer on client side
00368     unsigned char imageSource[256*3*3] = { 0 };
00369     
00370     // prepare sin lookup table (optional)
00371     initSinLut(); 
00372 
00373     // start the screen output, which will keep outputting the frames that are in its internal buffer (updated via .transformFrame)
00374     screen.start();
00375 
00376     while (1) {
00377         // Reload the file every 60 seconds
00378         if(s.read()>60)
00379         {
00380             //readTextFromMBed();
00381             //s.reset();
00382         }
00383         
00384         time++; //optional
00385         if(time%5000 == 0){
00386             frametype = (frametype+1)%5;
00387             if (frametype == 0)
00388                 time = 4500;
00389         }
00390             
00391         switch (frametype)
00392         {
00393             case 0:
00394                 makeFrame9(imageSource);
00395                 break;
00396             case 1:
00397                 makeFrame4(imageSource);
00398                 break;
00399             case 2:
00400                 makeFrame7(imageSource);
00401                 break;
00402             case 3:
00403                 makeFrame7(imageSource);
00404                 break;
00405             case 4:
00406                 makeFrame1(imageSource);
00407                 break;
00408         }
00409         
00410         //makeFrame2(imageSource);  // prepare framebuffer with current frame
00411         screen.transformFrame(imageSource); // write framebuffer to output framebuffer
00412         wait_ms(1); // slow down the framerate (optional)
00413     }
00414 
00415 }
00416 
00417 
00418 
00419 
00420 
00421 ////////////////////////////////
00422 ///////STOPPP!!!!!!!
00423 //////////GO BACK!!!!!!!
00424 ///////////////////////////////
00425 
00426 
00427 
00428 
00429 
00430 
00431 
00432 
00433 
00434 void initCharArray()
00435 {
00436     for(int i=0; i<128; i++){
00437         numbers[i].width=3;
00438         numbers[i].data=_C(1,1,1,0,0,
00439                            0,0,1,0,0,
00440                            0,1,1,0,0,
00441                            0,0,0,0,0,
00442                            0,1,0,0,0);
00443     }
00444     
00445     numbers['A'].width=3;
00446     numbers['A'].data=_C(1,1,1,0,0,
00447                          1,0,1,0,0,
00448                          1,1,1,0,0,
00449                          1,0,1,0,0,
00450                          1,0,1,0,0);
00451     numbers['B'].width=3;
00452     numbers['B'].data=_C(1,1,0,0,0,
00453                          1,0,1,0,0,
00454                          1,1,0,0,0,
00455                          1,0,1,0,0,
00456                          1,1,0,0,0);
00457     numbers['C'].width=3;
00458     numbers['C'].data=_C(1,1,1,0,0,
00459                          1,0,0,0,0,
00460                          1,0,0,0,0,
00461                          1,0,0,0,0,
00462                          1,1,1,0,0);
00463     numbers['D'].width=3;
00464     numbers['D'].data=_C(1,1,0,0,0,
00465                          1,0,1,0,0,
00466                          1,0,1,0,0,
00467                          1,0,1,0,0,
00468                          1,1,0,0,0);
00469     numbers['E'].width=3;
00470     numbers['E'].data=_C(1,1,1,0,0,
00471                          1,0,0,0,0,
00472                          1,1,1,0,0,
00473                          1,0,0,0,0,
00474                          1,1,1,0,0);
00475     numbers['F'].width=3;
00476     numbers['F'].data=_C(1,1,1,0,0,
00477                          1,0,0,0,0,
00478                          1,1,1,0,0,
00479                          1,0,0,0,0,
00480                          1,0,0,0,0);
00481     numbers['G'].width=3;
00482     numbers['G'].data=_C(1,1,1,0,0,
00483                          1,0,0,0,0,
00484                          1,0,0,0,0,
00485                          1,0,1,0,0,
00486                          1,1,1,0,0);
00487     numbers['H'].width=3;
00488     numbers['H'].data=_C(1,0,1,0,0,
00489                          1,0,1,0,0,
00490                          1,1,1,0,0,
00491                          1,0,1,0,0,
00492                          1,0,1,0,0);
00493     numbers['I'].width=3;
00494     numbers['I'].data=_C(1,1,1,0,0,
00495                          0,1,0,0,0,
00496                          0,1,0,0,0,
00497                          0,1,0,0,0,
00498                          1,1,1,0,0);
00499     numbers['J'].width=4;
00500     numbers['J'].data=_C(0,1,1,1,0,
00501                          0,0,1,0,0,
00502                          0,0,1,0,0,
00503                          1,0,1,0,0,
00504                          0,1,0,0,0);    
00505     numbers['K'].width=4;
00506     numbers['K'].data=_C(1,0,0,1,0,
00507                          1,0,1,0,0,
00508                          1,1,1,0,0,
00509                          1,0,1,0,0,
00510                          1,0,0,1,0);
00511     numbers['L'].width=3;
00512     numbers['L'].data=_C(1,0,0,0,0,
00513                          1,0,0,0,0,
00514                          1,0,0,0,0,
00515                          1,0,0,0,0,
00516                          1,1,1,0,0);
00517     numbers['M'].width=5;
00518     numbers['M'].data=_C(1,1,0,1,1,
00519                          1,1,1,1,1,
00520                          1,0,1,0,1,
00521                          1,0,0,0,1,
00522                          1,0,0,0,1);                      
00523     numbers['N'].width=4;
00524     numbers['N'].data=_C(1,0,0,1,0,
00525                          1,1,0,1,0,
00526                          1,1,1,1,0,
00527                          1,0,1,1,0,
00528                          1,0,0,1,0);
00529     numbers['O'].width=3;
00530     numbers['O'].data=_C(1,1,1,0,0,
00531                          1,0,1,0,0,
00532                          1,0,1,0,0,
00533                          1,0,1,0,0,
00534                          1,1,1,0,0);
00535     numbers['P'].width=3;
00536     numbers['P'].data=_C(1,1,1,0,0,
00537                          1,0,1,0,0,
00538                          1,1,1,0,0,
00539                          1,0,0,0,0,
00540                          1,0,0,0,0);
00541     numbers['Q'].width=3;
00542     numbers['Q'].data=_C(0,1,1,0,0,
00543                          1,0,0,1,0,
00544                          1,0,0,1,0,
00545                          1,0,1,1,0,
00546                          0,1,1,1,0);   
00547     numbers['R'].width=3;
00548     numbers['R'].data=_C(1,1,1,0,0,
00549                          1,0,1,0,0,
00550                          1,1,1,0,0,
00551                          1,1,0,0,0,
00552                          1,0,1,0,0);
00553     numbers['S'].width=3;
00554     numbers['S'].data=_C(1,1,1,0,0,
00555                          1,0,0,0,0,
00556                          1,1,1,0,0,
00557                          0,0,1,0,0,
00558                          1,1,1,0,0);
00559     numbers['T'].width=3;
00560     numbers['T'].data=_C(1,1,1,0,0,
00561                          0,1,0,0,0,
00562                          0,1,0,0,0,
00563                          0,1,0,0,0,
00564                          0,1,0,0,0);
00565     numbers['U'].width=3;
00566     numbers['U'].data=_C(1,0,1,0,0,
00567                          1,0,1,0,0,
00568                          1,0,1,0,0,
00569                          1,0,1,0,0,
00570                          1,1,1,0,0);
00571     numbers['V'].width=3;
00572     numbers['V'].data=_C(1,0,1,0,0,
00573                          1,0,1,0,0,
00574                          1,0,1,0,0,
00575                          1,0,1,0,0,
00576                          0,1,0,0,0);
00577     numbers['W'].width=5;
00578     numbers['W'].data=_C(1,0,0,0,1,
00579                          1,0,0,0,1,
00580                          1,0,1,0,1,
00581                          1,1,1,1,1,
00582                          0,1,0,1,0);
00583     numbers['X'].width=3;
00584     numbers['X'].data=_C(1,0,1,0,0,
00585                          1,0,1,0,0,
00586                          0,1,0,0,0,
00587                          1,1,1,0,0,
00588                          1,0,1,0,0);
00589     numbers['Y'].width=3;
00590     numbers['Y'].data=_C(1,0,1,0,0,
00591                          1,0,1,0,0,
00592                          0,1,0,0,0,
00593                          0,1,0,0,0,
00594                          0,1,0,0,0);
00595     numbers['Z'].width=3;
00596     numbers['Z'].data=_C(1,1,1,0,0,
00597                          0,0,1,0,0,
00598                          0,1,0,0,0,
00599                          1,0,0,0,0,
00600                          1,1,1,0,0);
00601     numbers['\''].width=1;
00602     numbers['\''].data=_C(1,0,0,0,0,
00603                           1,0,0,0,0,
00604                           0,0,0,0,0,
00605                           0,0,0,0,0,
00606                           0,0,0,0,0);
00607     numbers['"'].width=3;
00608     numbers['"'].data=_C(1,0,1,0,0,
00609                          1,0,1,0,0,
00610                          0,0,0,0,0,
00611                          0,0,0,0,0,
00612                          0,0,0,0,0);
00613     numbers[' '].width=1; 
00614     numbers[' '].data=_C(0,0,0,0,0,
00615                          0,0,0,0,0,
00616                          0,0,0,0,0,
00617                          0,0,0,0,0,
00618                          0,0,0,0,0);
00619     numbers[':'].width=1;
00620     numbers[':'].data=_C(0,0,0,0,0,
00621                          1,0,0,0,0,
00622                          0,0,0,0,0,
00623                          1,0,0,0,0,
00624                          0,0,0,0,0);
00625                          
00626     numbers['0'].width=3;
00627     numbers['0'].data=_C(1,1,1,0,0,
00628                          1,0,1,0,0,
00629                          1,0,1,0,0,
00630                          1,0,1,0,0,
00631                          1,1,1,0,0);
00632     numbers['1'].width=1;
00633     numbers['1'].data=_C(1,0,0,0,0,
00634                          1,0,0,0,0,
00635                          1,0,0,0,0,
00636                          1,0,0,0,0,
00637                          1,0,0,0,0);
00638     numbers['2'].width=3;
00639     numbers['2'].data=_C(1,1,1,0,0,
00640                          0,0,1,0,0,
00641                          1,1,1,0,0,
00642                          1,0,0,0,0,
00643                          1,1,1,0,0);
00644     numbers['3'].width=3;
00645     numbers['3'].data=_C(1,1,1,0,0,
00646                          0,0,1,0,0,
00647                          1,1,1,0,0,
00648                          0,0,1,0,0,
00649                          1,1,1,0,0);
00650     numbers['4'].width=3;
00651     numbers['4'].data=_C(1,0,1,0,0,
00652                          1,0,1,0,0,
00653                          1,1,1,0,0,
00654                          0,0,1,0,0,
00655                          0,0,1,0,0);
00656     numbers['5'].width=3;
00657     numbers['5'].data=_C(1,1,1,0,0,
00658                          1,0,0,0,0,
00659                          1,1,1,0,0,
00660                          0,0,1,0,0,
00661                          1,1,1,0,0);
00662     numbers['6'].width=3;
00663     numbers['6'].data=_C(1,1,1,0,0,
00664                          1,0,0,0,0,
00665                          1,1,1,0,0,
00666                          1,0,1,0,0,
00667                          1,1,1,0,0);
00668     numbers['7'].width=3;
00669     numbers['7'].data=_C(1,1,1,0,0,
00670                          0,0,1,0,0,
00671                          0,0,1,0,0,
00672                          0,0,1,0,0,
00673                          0,0,1,0,0);
00674     numbers['8'].width=3;
00675     numbers['8'].data=_C(1,1,1,0,0,
00676                          1,0,1,0,0,
00677                          1,1,1,0,0,
00678                          1,0,1,0,0,
00679                          1,1,1,0,0);
00680     numbers['9'].width=3;
00681     numbers['9'].data=_C(1,1,1,0,0,
00682                          1,0,1,0,0,
00683                          1,1,1,0,0,
00684                          0,0,1,0,0,
00685                          0,0,1,0,0);
00686                          
00687     numbers['.'].width=1;
00688     numbers['.'].data=_C(0,0,0,0,0,
00689                          0,0,0,0,0,
00690                          0,0,0,0,0,
00691                          0,0,0,0,0,
00692                          1,0,0,0,0);
00693 
00694     numbers['|'].width=1;
00695     numbers['|'].data=_C(1,0,0,0,0,
00696                          1,0,0,0,0,
00697                          1,0,0,0,0,
00698                          1,0,0,0,0,
00699                          1,0,0,0,0);
00700                          
00701     numbers[')'].width=2;
00702     numbers[')'].data=_C(1,0,0,0,0,
00703                          0,1,0,0,0,
00704                          0,1,0,0,0,
00705                          0,1,0,0,0,
00706                          1,0,0,0,0);
00707                          
00708     numbers['('].width=2;
00709     numbers['('].data=_C(0,1,0,0,0,
00710                          1,0,0,0,0,
00711                          1,0,0,0,0,
00712                          1,0,0,0,0,
00713                          0,1,0,0,0);
00714                          
00715     numbers['+'].width=3;
00716     numbers['+'].data=_C(0,0,0,0,0,
00717                          0,1,0,0,0,
00718                          1,1,1,0,0,
00719                          0,1,0,0,0,
00720                          0,0,0,0,0);
00721                          
00722     numbers['-'].width=3;
00723     numbers['-'].data=_C(0,0,0,0,0,
00724                          0,0,0,0,0,
00725                          1,1,1,0,0,
00726                          0,0,0,0,0,
00727                          0,0,0,0,0);
00728                          
00729     numbers[';'].width=2;
00730     numbers[';'].data=_C(0,0,0,0,0,
00731                          0,1,0,0,0,
00732                          0,0,0,0,0,
00733                          0,1,0,0,0,
00734                          1,0,0,0,0);
00735                          
00736     numbers['>'].width=3;
00737     numbers['>'].data=_C(1,0,0,0,0,
00738                          0,1,0,0,0,
00739                          0,0,1,0,0,
00740                          0,1,0,0,0,
00741                          1,0,0,0,0);
00742                          
00743     numbers[','].width=2;
00744     numbers[','].data=_C(0,0,0,0,0,
00745                          0,0,0,0,0,
00746                          0,0,0,0,0,
00747                          0,1,0,0,0,
00748                          1,0,0,0,0);
00749                          
00750     numbers['_'] = numbers[' '];
00751     numbers['a'] = numbers['A'];
00752     numbers['b'] = numbers['B'];
00753     numbers['c'] = numbers['C'];
00754     numbers['d'] = numbers['D'];
00755     numbers['e'] = numbers['E'];
00756     numbers['f'] = numbers['F'];
00757     numbers['g'] = numbers['G'];
00758     numbers['h'] = numbers['H'];
00759     numbers['i'] = numbers['I'];
00760     numbers['j'] = numbers['J'];
00761     numbers['k'] = numbers['K'];
00762     numbers['l'] = numbers['L'];
00763     numbers['m'] = numbers['M'];
00764     numbers['n'] = numbers['N'];
00765     numbers['o'] = numbers['O'];
00766     numbers['p'] = numbers['P'];
00767     numbers['q'] = numbers['Q'];
00768     numbers['r'] = numbers['R'];
00769     numbers['s'] = numbers['S'];
00770     numbers['t'] = numbers['T'];
00771     numbers['u'] = numbers['U'];
00772     numbers['v'] = numbers['V'];
00773     numbers['w'] = numbers['W'];
00774     numbers['x'] = numbers['X'];
00775     numbers['y'] = numbers['Y'];
00776     numbers['z'] = numbers['Z'];
00777                          
00778 }