![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Novo
Fork of LukaIElmir by
Diff: DotMatrix.h
- Revision:
- 5:654e3398c1ef
- Parent:
- 4:ba24ce878e87
- Child:
- 6:dd675b967b60
--- a/DotMatrix.h Mon May 26 17:39:37 2014 +0000 +++ b/DotMatrix.h Mon May 26 18:28:21 2014 +0000 @@ -2,7 +2,7 @@ #include "MatrixSPI.h" #include <string> #include <vector> - +#include "Znak.h" #ifndef DOTMATRIX_H #define DOTMATRIX_H @@ -49,11 +49,53 @@ return repeat; } + void inicijaliziraj(){ + znakovi[0] = Znak(0x7e, 0x11, 0x11, 0x7e); + znakovi[1] = Znak(0x7e, 0x49, 0x49, 0x36); + znakovi[2] = Znak(0x3e, 0x41, 0x41, 0x22); + znakovi[3] = Znak(0x7f, 0x41, 0x41, 0x3e); + + } + void setChar(char c, int offset) + { + int index = c - 'A'; + if(offset < 0) + { + for(int i = 0; i < znakovi[index].vel + offset; i++) + { + buffer[i] = znakovi[index].niz[i - offset]; + } + } + else + { + for(int i = offset; i < 8 && i < znakovi[index].vel + offset; i++) + { + buffer[i] = znakovi[index].niz[i - offset]; + } + } + + } + + void displaySingleChar(char c){ + setChar(c, 2); + refresh(); + } + int buffer[8]; + Znak znakovi[4]; private: void attach(); void prikaziScroll(){} - void prikaziCBC(){} + void prikaziCBC(){ + if(char_trenutni == recenica.size()) refresh(); + else { + displaySingleChar(recenica[char_trenutni]); + char_trenutni++; + if(char_trenutni == recenica.size() && repeat) + char_trenutni = 0; + + } + } MatrixSPI spi; @@ -67,4 +109,5 @@ int brzina_ms; }; + #endif //DotMatrix_h \ No newline at end of file