Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: DotMatrix.cpp
- Revision:
- 6:dd675b967b60
- Parent:
- 5:654e3398c1ef
diff -r 654e3398c1ef -r dd675b967b60 DotMatrix.cpp --- a/DotMatrix.cpp Mon May 26 18:28:21 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -#include "DotMatrix.h" -#include "MatrixSPI.h" - -void DotMatrix::refresh(){ - for(int i = 0; i < 8; i++) - { - spi.sendCol(i, buffer[i]); - buffer[i] = 0; - } -} - -void DotMatrix::setIntensity(float jacina){ - if(jacina <= 0){ - spi.turnOFF(); - turnedON = false; - - - } else if(jacina >= 0.98){ - if(!turnedON){ - spi.turnON(); - turnedON = true; - } - - spi.sendSingle(MatrixSPI::intensity, 0x0f); - } else { - if(!turnedON){ - spi.turnON(); - turnedON = true; - } - - int temp = jacina*0x0f; - spi.sendSingle(MatrixSPI::intensity, temp); - } -} - -void DotMatrix::attach() -{ - ticker.detach(); - if(mod == scroll) - { - ticker.attach(this, &DotMatrix::prikaziScroll, brzina_ms/8); - } else if(mod == char_by_char){ - ticker.attach(this, &DotMatrix::prikaziCBC, brzina_ms); - } -} - -void DotMatrix::setSpeed_ms(int ms) -{ - ticker.detach(); - - attach(); - -} - -void DotMatrix::turnON(){ - if(!turnedON){ - spi.turnON(); - turnedON = true; - - attach(); - } -} - -void DotMatrix::turnOFF(){ - if(turnedON){ - spi.turnOFF(); - turnedON = false; - - ticker.detach(); - } -} \ No newline at end of file