![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Novo
Fork of LukaIElmir by
DotMatrix.h
- Committer:
- tim003
- Date:
- 2014-05-26
- Revision:
- 4:ba24ce878e87
- Parent:
- 3:43648fa57d55
- Child:
- 5:654e3398c1ef
File content as of revision 4:ba24ce878e87:
#include "mbed.h" #include "MatrixSPI.h" #include <string> #include <vector> #ifndef DOTMATRIX_H #define DOTMATRIX_H enum ModPrikazivanja{scroll, char_by_char, live_input}; class DotMatrix{ public: DotMatrix(PinName data_input = dp2, PinName clock = dp6, PinName loadcs = dp24) :spi(data_input, clock, loadcs), turnedON(false), mod(scroll), char_trenutni(0), char_offset(0), repeat(true), brzina_ms(1000) { for(int i = 0; i < 8; i++) buffer[i] = 0; } void refresh(); void setIntensity(float jacina); void setSpeed_ms(int ms); void turnON(); void turnOFF(); void PromijeniRecenicu(string recenica){ this->recenica = recenica; } void NadodajNaRecenicu(char c){ recenica += c; } void NadodajNaRecenicu(string str){ recenica += str; } void PromijeniMod(ModPrikazivanja mod){ if(this->mod != mod){ this->mod = mod; attach(); } } ModPrikazivanja dajMod() const{ return mod; } void SetRepeat(bool r){ repeat = r; } bool GetRepeat() const{ return repeat; } int buffer[8]; private: void attach(); void prikaziScroll(){} void prikaziCBC(){} MatrixSPI spi; bool turnedON; string recenica; ModPrikazivanja mod; int char_trenutni, char_offset; Ticker ticker; //bool isAttached potrebno ako se ticker ne može 2. detachirati... bool repeat; int brzina_ms; }; #endif //DotMatrix_h