Simulation of 8X8 Matrix Display | Arduino & Android App
Simulation of 8X8 Dot Matrix Display using Arduino and Android App in Proteus
Components and supplies
1
HC-05 Bluetooth Module
1
MAX7219/MAX7221 LED Display Drivers
1
8X8 dot matrix display
1
Arduino UNO
Apps and platforms
1
DotMatrixController.apk
Project description
Code
CODE
c_cpp
1#include <MaxMatrix.h> 2#include <avr/pgmspace.h> 3 4 5int dIn = 7; // DIN pin of MAX7219 module 6int clk = 6; // CLK pin of MAX7219 module 7int cs = 5; // CS pin of MAX7219 module 8 9int maxInUse = 1; // Number of MAX7219's connected 10 11MaxMatrix m(dIn, cs, clk, maxInUse); 12 13PROGMEM const unsigned char CH[] = { 14 3, 8, B00000000, B00000000, B00000000, B00000000, B00000000, // space 15 1, 8, B01011111, B00000000, B00000000, B00000000, B00000000, // ! 16 3, 8, B00000011, B00000000, B00000011, B00000000, B00000000, // " 17 5, 8, B00010100, B00111110, B00010100, B00111110, B00010100, // # 18 4, 8, B00100100, B01101010, B00101011, B00010010, B00000000, // $ 19 5, 8, B01100011, B00010011, B00001000, B01100100, B01100011, // % 20 5, 8, B00110110, B01001001, B01010110, B00100000, B01010000, // & 21 1, 8, B00000011, B00000000, B00000000, B00000000, B00000000, // ' 22 3, 8, B00011100, B00100010, B01000001, B00000000, B00000000, // ( 23 3, 8, B01000001, B00100010, B00011100, B00000000, B00000000, // ) 24 5, 8, B00101000, B00011000, B00001110, B00011000, B00101000, // * 25 5, 8, B00001000, B00001000, B00111110, B00001000, B00001000, // + 26 2, 8, B10110000, B01110000, B00000000, B00000000, B00000000, // , 27 4, 8, B00001000, B00001000, B00001000, B00001000, B00000000, // - 28 2, 8, B01100000, B01100000, B00000000, B00000000, B00000000, // . 29 4, 8, B01100000, B00011000, B00000110, B00000001, B00000000, // / 30 4, 8, B00111110, B01000001, B01000001, B00111110, B00000000, // 0 31 3, 8, B01000010, B01111111, B01000000, B00000000, B00000000, // 1 32 4, 8, B01100010, B01010001, B01001001, B01000110, B00000000, // 2 33 4, 8, B00100010, B01000001, B01001001, B00110110, B00000000, // 3 34 4, 8, B00011000, B00010100, B00010010, B01111111, B00000000, // 4 35 4, 8, B00100111, B01000101, B01000101, B00111001, B00000000, // 5 36 4, 8, B00111110, B01001001, B01001001, B00110000, B00000000, // 6 37 4, 8, B01100001, B00010001, B00001001, B00000111, B00000000, // 7 38 4, 8, B00110110, B01001001, B01001001, B00110110, B00000000, // 8 39 4, 8, B00000110, B01001001, B01001001, B00111110, B00000000, // 9 40 2, 8, B01010000, B00000000, B00000000, B00000000, B00000000, // : 41 2, 8, B10000000, B01010000, B00000000, B00000000, B00000000, // ; 42 3, 8, B00010000, B00101000, B01000100, B00000000, B00000000, // < 43 3, 8, B00010100, B00010100, B00010100, B00000000, B00000000, // = 44 3, 8, B01000100, B00101000, B00010000, B00000000, B00000000, // > 45 4, 8, B00000010, B01011001, B00001001, B00000110, B00000000, // ? 46 5, 8, B00111110, B01001001, B01010101, B01011101, B00001110, // @ 47 4, 8, B01111110, B00010001, B00010001, B01111110, B00000000, // A 48 4, 8, B01111111, B01001001, B01001001, B00110110, B00000000, // B 49 4, 8, B00111110, B01000001, B01000001, B00100010, B00000000, // C 50 4, 8, B01111111, B01000001, B01000001, B00111110, B00000000, // D 51 4, 8, B01111111, B01001001, B01001001, B01000001, B00000000, // E 52 4, 8, B01111111, B00001001, B00001001, B00000001, B00000000, // F 53 4, 8, B00111110, B01000001, B01001001, B01111010, B00000000, // G 54 4, 8, B01111111, B00001000, B00001000, B01111111, B00000000, // H 55 3, 8, B01000001, B01111111, B01000001, B00000000, B00000000, // I 56 4, 8, B00110000, B01000000, B01000001, B00111111, B00000000, // J 57 4, 8, B01111111, B00001000, B00010100, B01100011, B00000000, // K 58 4, 8, B01111111, B01000000, B01000000, B01000000, B00000000, // L 59 5, 8, B01111111, B00000010, B00001100, B00000010, B01111111, // M 60 5, 8, B01111111, B00000100, B00001000, B00010000, B01111111, // N 61 4, 8, B00111110, B01000001, B01000001, B00111110, B00000000, // O 62 4, 8, B01111111, B00001001, B00001001, B00000110, B00000000, // P 63 4, 8, B00111110, B01000001, B01000001, B10111110, B00000000, // Q 64 4, 8, B01111111, B00001001, B00001001, B01110110, B00000000, // R 65 4, 8, B01000110, B01001001, B01001001, B00110010, B00000000, // S 66 5, 8, B00000001, B00000001, B01111111, B00000001, B00000001, // T 67 4, 8, B00111111, B01000000, B01000000, B00111111, B00000000, // U 68 5, 8, B00001111, B00110000, B01000000, B00110000, B00001111, // V 69 5, 8, B00111111, B01000000, B00111000, B01000000, B00111111, // W 70 5, 8, B01100011, B00010100, B00001000, B00010100, B01100011, // X 71 5, 8, B00000111, B00001000, B01110000, B00001000, B00000111, // Y 72 4, 8, B01100001, B01010001, B01001001, B01000111, B00000000, // Z 73 2, 8, B01111111, B01000001, B00000000, B00000000, B00000000, // [ 74 4, 8, B00000001, B00000110, B00011000, B01100000, B00000000, // \backslash 75 2, 8, B01000001, B01111111, B00000000, B00000000, B00000000, // ] 76 3, 8, B00000010, B00000001, B00000010, B00000000, B00000000, // hat 77 4, 8, B01000000, B01000000, B01000000, B01000000, B00000000, // _ 78 2, 8, B00000001, B00000010, B00000000, B00000000, B00000000, // ` 79 4, 8, B00100000, B01010100, B01010100, B01111000, B00000000, // a 80 4, 8, B01111111, B01000100, B01000100, B00111000, B00000000, // b 81 4, 8, B00111000, B01000100, B01000100, B00101000, B00000000, // c 82 4, 8, B00111000, B01000100, B01000100, B01111111, B00000000, // d 83 4, 8, B00111000, B01010100, B01010100, B00011000, B00000000, // e 84 3, 8, B00000100, B01111110, B00000101, B00000000, B00000000, // f 85 4, 8, B10011000, B10100100, B10100100, B01111000, B00000000, // g 86 4, 8, B01111111, B00000100, B00000100, B01111000, B00000000, // h 87 3, 8, B01000100, B01111101, B01000000, B00000000, B00000000, // i 88 4, 8, B01000000, B10000000, B10000100, B01111101, B00000000, // j 89 4, 8, B01111111, B00010000, B00101000, B01000100, B00000000, // k 90 3, 8, B01000001, B01111111, B01000000, B00000000, B00000000, // l 91 5, 8, B01111100, B00000100, B01111100, B00000100, B01111000, // m 92 4, 8, B01111100, B00000100, B00000100, B01111000, B00000000, // n 93 4, 8, B00111000, B01000100, B01000100, B00111000, B00000000, // o 94 4, 8, B11111100, B00100100, B00100100, B00011000, B00000000, // p 95 4, 8, B00011000, B00100100, B00100100, B11111100, B00000000, // q 96 4, 8, B01111100, B00001000, B00000100, B00000100, B00000000, // r 97 4, 8, B01001000, B01010100, B01010100, B00100100, B00000000, // s 98 3, 8, B00000100, B00111111, B01000100, B00000000, B00000000, // t 99 4, 8, B00111100, B01000000, B01000000, B01111100, B00000000, // u 100 5, 8, B00011100, B00100000, B01000000, B00100000, B00011100, // v 101 5, 8, B00111100, B01000000, B00111100, B01000000, B00111100, // w 102 5, 8, B01000100, B00101000, B00010000, B00101000, B01000100, // x 103 4, 8, B10011100, B10100000, B10100000, B01111100, B00000000, // y 104 3, 8, B01100100, B01010100, B01001100, B00000000, B00000000, // z 105 3, 8, B00001000, B00110110, B01000001, B00000000, B00000000, // { 106 1, 8, B01111111, B00000000, B00000000, B00000000, B00000000, // | 107 3, 8, B01000001, B00110110, B00001000, B00000000, B00000000, // } 108 4, 8, B00001000, B00000100, B00001000, B00000100, B00000000, // ~ 109}; 110 111byte buffer[40]; 112char incomebyte; 113int scrollSpeed = 100; 114char text[100] = "OverAll Technical Gyan "; // Initial text message 115int brightness = 15; 116int count = 0; 117char indicator; 118 119void setup() { 120 m.init(); // MAX7219 initialization 121 m.setIntensity(brightness); // initial led matrix intensity, 0-15 122 Serial.begin(9600); // Default communication rate of the Bluetooth module 123} 124 125void loop() { 126 // Printing the text 127 printStringWithShift(text, scrollSpeed); 128 129 if (Serial.available()) { // Checks whether data is comming from the serial port 130 indicator = Serial.read(); // Starts reading the serial port, the first byte from the incoming data 131 132 // If we have pressed the "Send" button from the Android App, clear the previous text 133 if (indicator == '1') { 134 for (int i = 0; i < 100; i++) { 135 text[i] = 0; 136 m.clear();} 137 // Read the whole data/string comming from the phone and put it into text[] array. 138 while (Serial.available()) { 139 incomebyte = Serial.read(); 140 text[count] = incomebyte; 141 count++; 142 } 143 count = 0; 144 } 145 146 // Adjusting the Scrolling Speed 147 else if (indicator == '2') { 148 String sS = Serial.readString(); 149 scrollSpeed = 150 - sS.toInt(); // Milliseconds, subtraction because lower value means higher scrolling speed 150 Serial.println(scrollSpeed); 151 } 152 153 // Adjusting the brightness 154 else if (indicator == '3') { 155 String sB = Serial.readString(); 156 brightness = sB.toInt(); 157 m.setIntensity(brightness); 158 } 159 } 160} 161 162void printStringWithShift(char* s, int shift_speed) { 163 while (*s != 0) { 164 printCharWithShift(*s, shift_speed); 165 s++; 166 } 167} 168 169void printCharWithShift(char c, int shift_speed) { 170 if (c < 32) return; 171 c -= 32; 172 memcpy_P(buffer, CH + 7 * c, 7); 173 m.writeSprite(32, 0, buffer); 174 m.setColumn(32 + buffer[0], 0); 175 176 for (int i = 0; i < buffer[0] + 1; i++) 177 { 178 delay(shift_speed); 179 m.shiftLeft(false, false); 180 } 181} 182 183 184 185
Downloadable files
Simulation of 8X8 Dot Matrix Display using Arduino and Android App in Proteus
Simulation of 8X8 Dot Matrix Display using Arduino and Android App in Proteus
Simulation of 8X8 Dot Matrix Display using Arduino and Android App in Proteus
Simulation of 8X8 Dot Matrix Display using Arduino and Android App in Proteus
Comments
Only logged in users can leave comments