diff --git a/es/blatt5/uebung5-1/uebung5-1.ino b/es/blatt5/uebung5-1/uebung5-1.ino index 2346408..6386d00 100644 --- a/es/blatt5/uebung5-1/uebung5-1.ino +++ b/es/blatt5/uebung5-1/uebung5-1.ino @@ -37,9 +37,7 @@ void setup() digitalWrite(dcPin, HIGH); // initialize screen buffer - for (int i = 0; i < maxBufferIndex; i++) { - screenBuffer[i] = 0x0; - } + resetBuffer(); } /** @@ -60,6 +58,9 @@ void loop() } +/** + * Resets display. + */ void resetDisplay() { digitalWrite(rstPin, LOW); @@ -67,6 +68,11 @@ void resetDisplay() digitalWrite(rstPin, HIGH); } +/** + * Writes the screen buffer into the display. + * + * It does NOT reset the buffer. + */ void flushBuffer() { for (int i = 0; i < maxBufferIndex; i++) { @@ -74,6 +80,18 @@ void flushBuffer() } } +/** + * Resets the buffer. + * + * Writes 0 in all fields. + */ +void resetBuffer() +{ + for (int i = 0; i < maxBufferIndex; i++) { + screenBuffer[i] = 0x0; + } +} + /** * Sets the pixel at the given location. * @param x