-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMeLEDMatrix.cpp
786 lines (695 loc) · 19.8 KB
/
MeLEDMatrix.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
/**
* \par Copyright (C), 2012-2015, MakeBlock
* \class MeLEDMatrix
* \brief Driver for Me LED Matrix module.
* @file MeLEDMatrix.cpp
* @author MakeBlock
* @version V1.0.3
* @date 2016/01/29
* @brief Driver for Me LED Matrix module.
*
* \par Copyright
* This software is Copyright (C), 2012-2015, MakeBlock. Use is subject to license \n
* conditions. The main licensing options available are GPL V2 or Commercial: \n
*
* \par Open Source Licensing GPL V2
* This is the appropriate option if you want to share the source code of your \n
* application with everyone you distribute it to, and you also want to give them \n
* the right to share who uses it. If you wish to use this software under Open \n
* Source Licensing, you must contribute all your source code to the open source \n
* community in accordance with the GPL Version 2 when your application is \n
* distributed. See http://www.gnu.org/copyleft/gpl.html
*
* \par Description
* This file is a drive for Me LED Matrix device
*
* \par Method List:
*
* 1. void MeLEDMatrix::clearScreen();
* 2. void MeLEDMatrix::setBrightness(uint8_t Bright);
* 3. void MeLEDMatrix::setColorIndex(bool Color_Number);
* 4. void MeLEDMatrix::drawBitmap(int8_t x, int8_t y, uint8_t Bitmap_Width, uint8_t *Bitmap);
* 5. void MeLEDMatrix::drawStr(int16_t X_position, int8_t Y_position, const char *str);
* 6. void MeLEDMatrix::showClock(uint8_t hour, uint8_t minute, bool point_flag);
* 7. void MeLEDMatrix::showNum(float value,uint8_t digits);
* 8. void MeLEDMatrix::reset(uint8_t port);
*
* \par History:
* <pre>
* `<Author>` `<Time>` `<Version>` `<Descr>`
* forfish 2015/11/11 1.0.0 Add description
* Mark Yan 2016/01/19 1.0.1 Add some new symbol
* Mark Yan 2016/01/27 1.0.2 Add digital printing
* Mark Yan 2016/01/29 1.0.3 Fix issue when show integer number
* </pre>
*
*/
#include "MeLEDMatrix.h"
#include "MeLEDMatrixData.h"
/**
* Alternate Constructor which can call your own function to map the LED Matrix to arduino port,
* no pins are used or initialized here.
* \param[in]
* None
*/
MeLEDMatrix::MeLEDMatrix():MePort()
{
}
/**
* Alternate Constructor which can call your own function to map the LED Matrix to arduino port,
* If the hardware serial was selected, we will used the hardware serial.
* \param[in]
* port - RJ25 port from PORT_1 to M2
*/
MeLEDMatrix::MeLEDMatrix(uint8_t port): MePort(port)
{
u8_SCKPin = s1;
u8_DINPin = s2;
pinMode(u8_SCKPin, OUTPUT);
pinMode(u8_DINPin, OUTPUT);
digitalWrite(u8_SCKPin,HIGH);
digitalWrite(u8_DINPin,HIGH);
writeByte(Mode_Address_Auto_Add_1);
setBrightness(Brightness_5);
clearScreen();
}
/**
* Alternate Constructor which can call your own function to map the Buzzer to arduino port,
* you can set any slot for the buzzer device.
* \param[in]
* SCK_Pin - The SCk of LED Matrix.
* \param[in]
* DIN_Pin - Put in parameter.
*/
MeLEDMatrix::MeLEDMatrix(uint8_t SCK_Pin, uint8_t DIN_Pin)
{
u8_SCKPin = SCK_Pin;
u8_DINPin = DIN_Pin;
pinMode(u8_SCKPin, OUTPUT);
pinMode(u8_DINPin, OUTPUT);
digitalWrite(u8_SCKPin,HIGH);
digitalWrite(u8_DINPin,HIGH);
writeByte(Mode_Address_Auto_Add_1);
setBrightness(Brightness_5);
clearScreen();
}
/**
* \par Function
* reset
* \par Description
* Reset the port of LED Matrix.
* \param[in]
* port - The port of LED Matrix.
* \par Output
* None
* \Return
* None.
* \par Others
* None
*/
void MeLEDMatrix::reset(uint8_t port){
u8_SCKPin = mePort[port].s1;
u8_DINPin = mePort[port].s2;
_port = port;
pinMode(u8_SCKPin, OUTPUT);
pinMode(u8_DINPin, OUTPUT);
digitalWrite(u8_SCKPin,HIGH);
digitalWrite(u8_DINPin,HIGH);
writeByte(Mode_Address_Auto_Add_1);
setBrightness(Brightness_5);
clearScreen();
}
/**
* \par Function
* writeByte
* \par Description
* Write byte to LED Matrix.
* \param[in]
* data - The data wrote to LED Matrix.
* \par Output
* None
* \Return
* None.
* \par Others
* None
*/
void MeLEDMatrix::writeByte(uint8_t data)
{
//Start
digitalWrite(u8_SCKPin, HIGH);
digitalWrite(u8_DINPin, LOW);
for(char i=0;i<8;i++)
{
digitalWrite(u8_SCKPin, LOW);
digitalWrite(u8_DINPin, (data & 0x01));
digitalWrite(u8_SCKPin, HIGH);
data = data >> 1;
}
//End
digitalWrite(u8_SCKPin, LOW);
digitalWrite(u8_DINPin, LOW);
digitalWrite(u8_SCKPin, HIGH);
digitalWrite(u8_DINPin, HIGH);
// delayMicroseconds(1);
}
/**
* \par Function
* writeBytesToAddress
* \par Description
* Write byte to LED Matrix's address.
* \param[in]
* Address - The address you want to write in LED Matrix.
* \param[in]
* P_data - The pointer points to data.
* \param[in]
* count_of_data - The length of data.
* \par Output
* None
* \Return
* None.
* \par Others
* None
*/
void MeLEDMatrix::writeBytesToAddress(uint8_t Address, const uint8_t *P_data, uint8_t count_of_data)
{
uint8_t T_data;
if(Address > 15 || count_of_data==0)
return;
Address = ADDRESS(Address);
//Start
digitalWrite(u8_SCKPin, HIGH);
digitalWrite(u8_DINPin, LOW);
//write Address
for(char i=0;i<8;i++)
{
digitalWrite(u8_SCKPin, LOW);
digitalWrite(u8_DINPin, (Address & 0x01));
digitalWrite(u8_SCKPin, HIGH);
Address = Address >> 1;
}
//write data
for(uint8_t k=0; k<count_of_data; k++)
{
T_data = *(P_data + k);
for(char i=0;i<8;i++)
{
digitalWrite(u8_SCKPin, LOW);
digitalWrite(u8_DINPin, (T_data & 0x80));
digitalWrite(u8_SCKPin, HIGH);
T_data = T_data << 1;
}
}
//End
digitalWrite(u8_SCKPin, LOW);
digitalWrite(u8_DINPin, LOW);
digitalWrite(u8_SCKPin, HIGH);
digitalWrite(u8_DINPin, HIGH);
// delayMicroseconds(1);
}
/**
* \par Function
* clearScreen
* \par Description
* Clear the screen.
* \param[in]
* None
* \par Output
* None
* \Return
* None.
* \par Others
* None
*/
void MeLEDMatrix::clearScreen()
{
for(uint8_t i=0;i<LED_BUFFER_SIZE;i++)
{
u8_Display_Buffer[i] = 0x00;
}
b_Color_Index = 1;
b_Draw_Str_Flag = 0;
writeBytesToAddress(0,u8_Display_Buffer,LED_BUFFER_SIZE);
}
/**
* \par Function
* setBrightness
* \par Description
* Set the brightness of LED Matrix.
* \param[in]
* Bright - The brightness of LED Matrix.
* \par Output
* None
* \Return
* None.
* \par Others
* None
*/
void MeLEDMatrix::setBrightness(uint8_t Bright)
{
if((uint8_t)Bright>8)
{
Bright = Brightness_8;
}
if((uint8_t)Bright != 0)
{
Bright = (LED_Matrix_Brightness_TypeDef)((uint8_t)(Bright-1)|0x08);
}
writeByte(0x80 | (uint8_t)Bright);
}
/**
* \par Function
* setColorIndex
* \par Description
* Set the color index for LED Matrix.
* \param[in]
* Color_Number - The number of LED Matrix's color.
* \par Output
* None
* \Return
* None.
* \par Others
* None
*/
void MeLEDMatrix::setColorIndex(bool Color_Number)
{
b_Color_Index = Color_Number;
}
/**
* \par Function
* drawBitmap
* \par Description
* Draw a bitmap.
* \param[in]
* x - The x coordinate of bitmap.
* \param[in]
* y - The y coordinate of bitmap.
* \param[in]
* Bitmap_Width - The width of bitmap.
* \param[in]
* Bitmap - A pointer to bitmap.
* \par Output
* None
* \Return
* None.
* \par Others
* None
*/
void MeLEDMatrix::drawBitmap(int8_t x, int8_t y, uint8_t Bitmap_Width, uint8_t *Bitmap)
{
if(x>15 || y>7 || Bitmap_Width==0)
return;
if(b_Color_Index == 1)
{
for(uint8_t k=0;k<Bitmap_Width;k++)
{
if(x+k>=0){
u8_Display_Buffer[x+k] = (u8_Display_Buffer[x+k] & (0xff << (8-y))) | (y>0?(Bitmap[k] >> y):(Bitmap[k] << (-y)));
}
}
}
else if(b_Color_Index == 0)
{
for(uint8_t k=0;k<Bitmap_Width;k++)
{
if(x+k>=0){
u8_Display_Buffer[x+k] = (u8_Display_Buffer[x+k] & (0xff << (8-y))) | (y>0?(~Bitmap[k] >> y):(~Bitmap[k] << (-y)));
}
}
}
writeBytesToAddress(0,u8_Display_Buffer,LED_BUFFER_SIZE);
}
/**
* \par Function
* drawStr
* \par Description
* Draw a string.
* \param[in]
* x - The x coordinate for the beginning of string.
* \param[in]
* y - The y coordinate for the beginning of string.
* \param[in]
* str - A pointer to string.
* \par Output
* None
* \Return
* None.
* \par Others
* None
*/
void MeLEDMatrix::drawStr(int16_t X_position, int8_t Y_position, const char *str)
{
b_Draw_Str_Flag = 1;
for(i16_Number_of_Character_of_Str = 0; str[i16_Number_of_Character_of_Str] != '\0'; i16_Number_of_Character_of_Str++)
{
if(i16_Number_of_Character_of_Str < STRING_DISPLAY_BUFFER_SIZE - 1)
{
i8_Str_Display_Buffer[i16_Number_of_Character_of_Str] = str[i16_Number_of_Character_of_Str];
}
else
{
break;
}
}
i8_Str_Display_Buffer[i16_Number_of_Character_of_Str] = '\0';
if(X_position < -(i16_Number_of_Character_of_Str * 6))
{
X_position = -(i16_Number_of_Character_of_Str * 6);
}
else if(X_position > 16)
{
X_position = 16;
}
i16_Str_Display_X_Position = X_position;
if(Y_position < -1)
{
Y_position = -1;
}
else if(Y_position >15)
{
Y_position = 15;
}
i8_Str_Display_Y_Position = Y_position;
showStr();
}
/**
* \par Function
* showStr
* \par Description
* Show the string in LED Matrix.
* \par Output
* None
* \Return
* None.
* \par Others
* None
*/
void MeLEDMatrix::showStr()
{
uint8_t display_buffer_label = 0;
if(i16_Str_Display_X_Position > 0)
{
for(display_buffer_label = 0; display_buffer_label < i16_Str_Display_X_Position && display_buffer_label < LED_BUFFER_SIZE; display_buffer_label++)
{
u8_Display_Buffer[display_buffer_label] = 0x00;
}
if(display_buffer_label < LED_BUFFER_SIZE)
{
uint8_t num;
for(uint8_t k=0;display_buffer_label < LED_BUFFER_SIZE && k < i16_Number_of_Character_of_Str;k++)
{
for(num=0; pgm_read_byte(&Character_font_6x8[num].Character[0]) != '@'; num++)
{
if(i8_Str_Display_Buffer[k] == pgm_read_byte(&Character_font_6x8[num].Character[0]))
{
for(uint8_t j=0;j<6;j++)
{
u8_Display_Buffer[display_buffer_label] = pgm_read_byte(&Character_font_6x8[num].data[j]);
display_buffer_label++;
if(display_buffer_label >= LED_BUFFER_SIZE)
{
break;
}
}
break;
}
}
if(pgm_read_byte(&Character_font_6x8[num].Character[0]) == '@')
{
i8_Str_Display_Buffer[k] = ' ';
k--;
}
}
if(display_buffer_label < LED_BUFFER_SIZE)
{
for(display_buffer_label = display_buffer_label; display_buffer_label < LED_BUFFER_SIZE; display_buffer_label++)
{
u8_Display_Buffer[display_buffer_label] = 0x00;
}
}
}
}
else if(i16_Str_Display_X_Position <= 0)
{
if(i16_Str_Display_X_Position == -(i16_Number_of_Character_of_Str * 6))
{
for(; display_buffer_label < LED_BUFFER_SIZE; display_buffer_label++)
{
u8_Display_Buffer[display_buffer_label] = 0x00;
}
}
else
{
int8_t j = (-i16_Str_Display_X_Position) % 6;
uint8_t num;
i16_Str_Display_X_Position = -i16_Str_Display_X_Position;
for(int16_t k=i16_Str_Display_X_Position/6; display_buffer_label < LED_BUFFER_SIZE && k < i16_Number_of_Character_of_Str;k++)
{
for(num=0; pgm_read_byte(&Character_font_6x8[num].Character[0]) != '@'; num++)
{
if(i8_Str_Display_Buffer[k] == pgm_read_byte(&Character_font_6x8[num].Character[0]))
{
for(;j<6;j++)
{
u8_Display_Buffer[display_buffer_label] = pgm_read_byte(&Character_font_6x8[num].data[j]);
display_buffer_label++;
if(display_buffer_label >= LED_BUFFER_SIZE)
{
break;
}
}
j=0;
break;
}
}
if(pgm_read_byte(&Character_font_6x8[num].Character[0]) == '@')
{
i8_Str_Display_Buffer[k] = ' ';
k--;
}
}
if(display_buffer_label < LED_BUFFER_SIZE)
{
for(; display_buffer_label < LED_BUFFER_SIZE; display_buffer_label++)
{
u8_Display_Buffer[display_buffer_label] = 0x00;
}
}
i16_Str_Display_X_Position = -i16_Str_Display_X_Position;
}
}
if(7 - i8_Str_Display_Y_Position >= 0)
{
for(uint8_t k=0; k<LED_BUFFER_SIZE; k++)
{
u8_Display_Buffer[k] = u8_Display_Buffer[k] << (7 - i8_Str_Display_Y_Position);
}
}
else
{
for(uint8_t k=0; k<LED_BUFFER_SIZE; k++)
{
u8_Display_Buffer[k] = u8_Display_Buffer[k] >> (i8_Str_Display_Y_Position - 7);
}
}
if(b_Color_Index == 0)
{
for(uint8_t k=0; k<LED_BUFFER_SIZE; k++)
{
u8_Display_Buffer[k] = ~u8_Display_Buffer[k];
}
}
writeBytesToAddress(0,u8_Display_Buffer,LED_BUFFER_SIZE);
}
/**
* \par Function
* showClock
* \par Description
* Show the clock on LED Matrix.
* \param[in]
* hour - The part of hour in clock.
* \param[in]
* minute - The part of minute in clock.
* \param[in]
* PointOn - Point on or not.
* \par Output
* None
* \Return
* None.
* \par Others
* None
*/
void MeLEDMatrix::showClock(uint8_t hour, uint8_t minute, bool point_flag)
{
u8_Display_Buffer[0] = pgm_read_byte(&Clock_Number_font_3x8[hour/10].data[0]);
u8_Display_Buffer[1] = pgm_read_byte(&Clock_Number_font_3x8[hour/10].data[1]);
u8_Display_Buffer[2] = pgm_read_byte(&Clock_Number_font_3x8[hour/10].data[2]);
u8_Display_Buffer[3] = 0x00;
u8_Display_Buffer[4] = pgm_read_byte(&Clock_Number_font_3x8[hour%10].data[0]);
u8_Display_Buffer[5] = pgm_read_byte(&Clock_Number_font_3x8[hour%10].data[1]);
u8_Display_Buffer[6] = pgm_read_byte(&Clock_Number_font_3x8[hour%10].data[2]);
u8_Display_Buffer[9] = pgm_read_byte(&Clock_Number_font_3x8[minute/10].data[0]);
u8_Display_Buffer[10] = pgm_read_byte(&Clock_Number_font_3x8[minute/10].data[1]);
u8_Display_Buffer[11] = pgm_read_byte(&Clock_Number_font_3x8[minute/10].data[2]);
u8_Display_Buffer[12] = 0x00;
u8_Display_Buffer[13] = pgm_read_byte(&Clock_Number_font_3x8[minute%10].data[0]);
u8_Display_Buffer[14] = pgm_read_byte(&Clock_Number_font_3x8[minute%10].data[1]);
u8_Display_Buffer[15] = pgm_read_byte(&Clock_Number_font_3x8[minute%10].data[2]);
if(point_flag == PointOn)
{
u8_Display_Buffer[7] = 0x28;
u8_Display_Buffer[8] = 0x28;
}
else
{
u8_Display_Buffer[7] = 0x00;
u8_Display_Buffer[8] = 0x00;
}
if(b_Color_Index == 0)
{
for(uint8_t k=0; k<LED_BUFFER_SIZE; k++)
{
u8_Display_Buffer[k] = ~u8_Display_Buffer[k];
}
}
writeBytesToAddress(0,u8_Display_Buffer,LED_BUFFER_SIZE);
}
/**
* \par Function
* showNum
* \par Description
* Show the number on LED Matrix.
* \param[in]
* value - The float data need show.
* \param[in]
* digits - Number of digits to display.
* \par Output
* None
* \Return
* None.
* \par Others
* None
*/
void MeLEDMatrix::showNum(float value,uint8_t digits)
{
Posotion_1:
uint8_t buf[4] = { 0x0c, 0x0c, 0x0c, 0x0c};
uint8_t tempBuf[4];
uint8_t b = 0;
uint8_t bit_num = 0;
uint8_t int_num = 0;
uint8_t isNeg = 0;
double number = value;
if (number >= 9999.5)
{
buf[0] = 9;
buf[1] = 9;
buf[2] = 9;
buf[3] = 9;
}
else if(number <= -999.5)
{
buf[0] = 0x0b;
buf[1] = 9;
buf[2] = 9;
buf[3] = 9;
}
else
{
// Handle negative numbers
if (number < 0.0)
{
number = -number;
isNeg = 1;
}
// Round correctly so that print(1.999, 2) prints as "2.00"
double rounding = 0.5;
for (uint8_t i = 0; i < digits; ++i)
{
rounding /= 10.0;
}
number += rounding;
// Extract the integer part of the number and print it
uint16_t int_part = (uint16_t)number;
double remainder = number - (double)int_part;
do
{
uint16_t m = int_part;
int_part /= 10;
int8_t c = m - 10 * int_part;
tempBuf[int_num] = c;
int_num++;
}
while (int_part);
bit_num = isNeg + int_num + digits;
if (bit_num > 4)
{
bit_num = 4;
digits = 4 - (isNeg + int_num);
goto Posotion_1;
}
b = 4 - bit_num;
if (isNeg)
{
buf[b++] = 0x0b; // '-' display minus sign
}
for (uint8_t i = int_num; i > 0; i--)
{
buf[b++] = tempBuf[i - 1];
}
// Print the decimal point, but only if there are digits beyond
if (digits > 0)
{
if((b == 3) && (int16_t(remainder*10) == 0))
{
buf[3] = 0x0c;
}
else if((b == 2) && (int16_t(remainder*100) == 0))
{
buf[2] = 0x0c;
buf[3] = 0x0c;
}
else if((b == 1) && (int16_t(remainder*1000) == 0))
{
buf[1] = 0x0c;
buf[2] = 0x0c;
buf[3] = 0x0c;
}
else
{
buf[b++] = 0x0a; // display '.'
// Extract digits from the remainder one at a time
while (digits-- > 0)
{
remainder *= 10.0;
int16_t toPrint = int16_t(remainder);
buf[b++] = toPrint;
remainder -= toPrint;
}
}
}
}
u8_Display_Buffer[0] = pgm_read_byte(&Clock_Number_font_3x8[buf[0]].data[0]);
u8_Display_Buffer[1] = pgm_read_byte(&Clock_Number_font_3x8[buf[0]].data[1]);
u8_Display_Buffer[2] = pgm_read_byte(&Clock_Number_font_3x8[buf[0]].data[2]);
u8_Display_Buffer[3] = 0x00;
u8_Display_Buffer[4] = pgm_read_byte(&Clock_Number_font_3x8[buf[1]].data[0]);
u8_Display_Buffer[5] = pgm_read_byte(&Clock_Number_font_3x8[buf[1]].data[1]);
u8_Display_Buffer[6] = pgm_read_byte(&Clock_Number_font_3x8[buf[1]].data[2]);
u8_Display_Buffer[7] = 0x00;
u8_Display_Buffer[8] = pgm_read_byte(&Clock_Number_font_3x8[buf[2]].data[0]);
u8_Display_Buffer[9] = pgm_read_byte(&Clock_Number_font_3x8[buf[2]].data[1]);
u8_Display_Buffer[10] = pgm_read_byte(&Clock_Number_font_3x8[buf[2]].data[2]);
u8_Display_Buffer[11] = 0x00;
u8_Display_Buffer[12] = pgm_read_byte(&Clock_Number_font_3x8[buf[3]].data[0]);
u8_Display_Buffer[13] = pgm_read_byte(&Clock_Number_font_3x8[buf[3]].data[1]);
u8_Display_Buffer[14] = pgm_read_byte(&Clock_Number_font_3x8[buf[3]].data[2]);
u8_Display_Buffer[15] = 0x00;
if(b_Color_Index == 0)
{
for(uint8_t k=0; k<LED_BUFFER_SIZE; k++)
{
u8_Display_Buffer[k] = ~u8_Display_Buffer[k];
}
}
writeBytesToAddress(0,u8_Display_Buffer,LED_BUFFER_SIZE);
}