Skip to content

Commit 63dc8a0

Browse files
committed
Add info about text logging feature
1 parent de40835 commit 63dc8a0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

UPGRADE-3.0.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ void overlay1(OLEDDisplay *display, OLEDDisplayUiState* state);
5656

5757
## New Features
5858

59+
### Loading Animation
60+
5961
While using this library ourself we noticed a pattern emerging. We want to drawing
6062
a loading progress while connecting to WiFi and updating weather data etc.
6163

@@ -105,3 +107,19 @@ void myLoadingDraw(OLEDDisplay *display, LoadingStage* stage, uint8_t progress)
105107
106108
After defining a function like that, you can pass it to the Ui library by use
107109
`ui.setLoadingDrawFunction(myLoadingDraw)`.
110+
111+
112+
### Text Logging
113+
114+
It is always useful to display some text on the display without worrying to much
115+
where it goes and managing it. In 3.0 we made the `OLEDDisplay` class implement
116+
[`Print`](https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/Print.h)
117+
so you can use it like you would use `Serial`. We calls this feature `LogBuffer`
118+
and the only thing you have to do is to define how many lines you want to display
119+
and how many characters there are on average on each. This is done by calling
120+
`setLogBuffer(lines, chars);`. If there is not enough memory the function will
121+
return false.
122+
123+
After that you can draw the `LogBuffer` anywhere you want by calling `drawLogBuffer(x, y)`.
124+
(Note: You have to call `display()` to update the screen)
125+
We made a [video](https://www.youtube.com/watch?v=8Fiss77A3TE) showing this feature in action.

0 commit comments

Comments
 (0)