| 11 | // display array size |
| 12 | #define display_array_size 64 |
| 13 | // ascii 5x7 dot font |
| 14 | #define data_ascii_A 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, 0x00, 0x00 // A 65 |
| 15 | #define data_ascii_R 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, 0x00, 0x00 // R 82 |
| 16 | #define data_ascii_D 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x00, 0x00 // D 68 |
| 17 | #define data_ascii_U 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, 0x00, 0x00 // U 85 |
| 18 | #define data_ascii_I 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, 0x00, 0x00 // I 73 |
| 19 | #define data_ascii_N 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, 0x00, 0x00 // N 78 |
| 20 | #define data_ascii_O 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x00, 0x00 // O 79 |
| 21 | #define data_ascii_colon 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 // : 58 |
| 22 | // byte data_0[5]={0x03E, B00111110, 0x049, 0x045, 0x03E}; |
| 23 | // display array |
| 24 | byte data_ascii[][display_array_size] = { |
| 25 | data_ascii_A, |
| 26 | data_ascii_R, |
| 27 | data_ascii_D, |
| 28 | data_ascii_U, |
| 29 | data_ascii_I, |
| 30 | data_ascii_N, |
| 31 | data_ascii_O, |
| 32 | data_ascii_colon |
| 33 | }; |
12 | | #define data_ascii_Y {0x03, 0x04, 0x78, 0x04, 0x03} // Y 89 |
13 | | #define data_ascii_Z {0x61, 0x59, 0x49, 0x4D, 0x43} // Z 90 |
14 | | //byte data_0[5]={0x03E, B00111110, 0x049, 0x045, 0x03E}; |
15 | | byte data_0[8]={0x03E, 0x051, 0x049, 0x045, 0x03E, 0x0FF, 0x0FF, 0x0FF}; |
16 | | // ascii 5x7 dot font |
17 | | byte data_ascii[][8] = { |
18 | | data_ascii_Z |
19 | | }; // 9 |
20 | | |
21 | | //Pin connected to ST_CP of 74HC595 for scanning |
| 35 | // Pin connected to ST_CP of 74HC595 for scanning |
48 | | for (int j = 0; j < 8; j++) { |
49 | | //ground scan_latch_pin and hold low for as long as you are transmitting |
50 | | digitalWrite(scan_latch_pin, LOW); |
51 | | shiftOut(scan_data_pin, scan_clock_pin, MSBFIRST, int(1 << j)); |
52 | | shiftOut(scan_data_pin, scan_clock_pin, MSBFIRST, int(data_ascii[0][j] )); |
53 | | //return the latch pin high to signal chip that it |
54 | | //no longer needs to listen for information |
55 | | digitalWrite(scan_latch_pin, HIGH); |
56 | | //Serial.println(data_ascii[0][j] ^= 0xFF, HEX); |
57 | | delay(1); |
| 61 | for (int k = 0; k < continue_time; k++) |
| 62 | { |
| 63 | for (int j = index; j < (index + 8); j++) { |
| 64 | //ground scan_latch_pin and hold low for as long as you are transmitting |
| 65 | digitalWrite(scan_latch_pin, LOW); |
| 66 | shiftOut(scan_data_pin, scan_clock_pin, MSBFIRST, int(1 << (j-index))); |
| 67 | shiftOut(scan_data_pin, scan_clock_pin, MSBFIRST, int(data_ascii[0][j] )); |
| 68 | //return the latch pin high to signal chip that it |
| 69 | //no longer needs to listen for information |
| 70 | digitalWrite(scan_latch_pin, HIGH); |
| 71 | //Serial.print(1 << j-index, HEX); |
| 72 | //Serial.print(" = "); |
| 73 | //Serial.println(data_ascii[0][j], HEX); |
| 74 | //delay(1000); |
| 75 | } |