Mark Banfield / Mbed 2 deprecated LED_dot_matrix_4

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 /*
00004 MJB
00005 10th August 2010
00006 
00007 
00008 To power a LED 7x5 dot matrix.
00009 
00010 This project uses the display from RS Components: 247-3141.
00011 
00012 The connections are as follows:
00013     Pin 16 = column 1 Display pin 1 (left-most column)
00014     Pin 17 = column 2 Display pin 3
00015     Pin 18 = column 3 Display pin 10
00016     Pin 19 = column 4 Display pin 7
00017     Pin 20 = column 5 Display pin 8 (right-most column)
00018 
00019     Pin 21 = row 1 Display pin 12 (top-most row)
00020     Pin 22 = row 2 Display pin 11
00021     Pin 23 = row 3 Display pin 2
00022     Pin 24 = row 4 Display pin 9
00023     Pin 25 = row 5 Display pin 4
00024     Pin 26 = row 6 Display pin 5
00025     Pin 27 = row 7 Display pin 6
00026 
00027     The code causes the message to scroll across the display.
00028 */
00029 
00030 BusOut Rows (p21, p22, p23, p24, p25, p26, p27);
00031 BusOut Cols (p16, p17, p18, p19, p20);
00032 BusOut IntLEDs(LED1, LED2, LED3, LED4);
00033 
00034 
00035 int DotPattern1[] = {0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
00036                      0x7F, 0x00, 0x7F, 0x7E, 0x7E,
00037                      0x00, 0x7E, 0x7E, 0x7F, 0x78,
00038                      0x47, 0x3F, 0x47, 0x3F, 0x47,
00039                      0x78, 0x7F, 0x7F, 0x7F, 0x7F,
00040                      0x5D, 0x3A, 0x36, 0x4D, 0x7F,
00041                      0x43, 0x3F, 0x5F, 0x3F, 0x43,
00042                      0x7F, 0x02, 0x7F, 0x7D, 0x40,
00043                      0x3D, 0x5D, 0x7F, 0x47, 0x3B,
00044                      0x3B, 0x57, 0x7F, 0x00, 0x7B,
00045                      0x03, 0x7F, 0x47, 0x2B, 0x2B,
00046                      0x37, 0x7F, 0x37, 0x2B, 0x5B,
00047                      0x7F, 0x7F, 0x7F, 0x7F, 0x7F,
00048                      0x7f, 0x7f, 0x7f, 0x7f, 0x7f
00049                     };  //Message = "ITW Switches".
00050 
00051 float count;
00052 int ColCount;
00053 int pattern;
00054 int loop;
00055 int index;
00056 
00057 int main() {
00058 
00059     while (1) {
00060 
00061         index=0;
00062         while (index<65) {
00063             loop=0;
00064             while (loop<4) {
00065             IntLEDs = index;
00066                 count = 1;
00067                 pattern = 0+index;
00068                 while (count<0x20) {
00069                     Cols = count;
00070                     Rows = DotPattern1[pattern];
00071                     wait_ms(5);
00072                     count = count*2;
00073                     pattern++;
00074                 }
00075                 loop++;
00076             }
00077 
00078             index++;
00079         }
00080     }
00081 }
00082 
00083 
00084 
00085 
00086