Page 125 - 15 Dangerously Mad Projects for the Evil Genius
P. 125

104       15 Dangerously Mad Projects for the Evil Genius



























         Figure 8-35   Persistence of vision




          LISTING 8-1

           long period = 400;
           int ledPins[6][3] = {{4, 3, 2}, {7, 6, 5}, {10, 9, 8}, {13, 12, 11},
               {16, 15, 14}, {19, 18, 17}};
           int n = 128;
           char *message[6] = {
           "000000000000000000000000000000000000000000000000000000000000000000000000000000000
               00000000000000000000000000000000770000000000000",
           "111111100220000022000333300044000000000000000000555555006666666001100011000222200
               03300033000444440000000000000000770000000000000",
           "110000000022000220000033000044000000077770000005500000006600000001110011000022000
               03300033004400000000000000000000770000000000000",
           "111110000002202200000033000044000000077770000005555550006666600001111011000022000
               03300033000444440000000000000000770000000000000",
           "110000000000222000000033000044000000000000000005500055006600000001100111000022000
               03300033000000044000000000000000770000000000000",
           "111111100000020000000333300044444000000000000000555550006666666001100011000222200
               00333330004444440000000000000000770000000000000"
           };
           void setup()
           {
             for (int led = 0; led < 6; led ++)
             {
               for (int color = 0; color < 3; color++)
               {
                 pinMode(ledPins[led][color], OUTPUT);
               }
             }
           }
           void loop()
   120   121   122   123   124   125   126   127   128   129   130