-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLedDriver.cpp
More file actions
28 lines (24 loc) · 802 Bytes
/
LedDriver.cpp
File metadata and controls
28 lines (24 loc) · 802 Bytes
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
/**
* LedDriver.cpp
* Abstrakte Klasse fuer einen LED-Treiber. Hiervon koennen andere Implementierungen
* erben (75HC595, MAX7219, AS1130 etc.)
*
* @mc Arduino/RBBB
* @autor Christian Aschoff / caschoff _AT_ mac _DOT_ com
* @version 1.3
* @created 18.1.2013
* @updated 18.8.2013
*
* Versionshistorie:
* V 1.0: - Erstellt.
* V 1.1: - printSignature() eingefuehrt.
* V 1.2: - Setzten und lesen von Pixel eingefuehrt.
* V 1.3: - Anpassung auf Helligkeit in Prozent.
*/
#include "LedDriver.h"
void LedDriver::setPixelInScreenBuffer(byte x, byte y, word matrix[16]) {
matrix[y] |= 0b1000000000000000 >> x;
}
boolean LedDriver::getPixelFromScreenBuffer(byte x, byte y, word matrix[16]) {
return (matrix[y] & (0b1000000000000000 >> x)) == (0b1000000000000000 >> x);
}