Skip to content

Commit 48226c9

Browse files
committed
Updated the README file with missing API functions
1 parent 001b13b commit 48226c9

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

OLEDDisplay.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,8 @@ class OLEDDisplay {
147147
// Draw a lin vertically
148148
void drawVerticalLine(int16_t x, int16_t y, int16_t length);
149149

150-
/**
151-
* Draws a rounded progress bar with the outer dimensions given by width and height.
152-
*/
150+
// Draws a rounded progress bar with the outer dimensions given by width and height. Progress is
151+
// a unsigned byte value between 0 and 100
153152
void drawProgressBar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t progress);
154153

155154
// Draw a bitmap in the internal image format

README.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ This is a driver for the SSD1306 based 128x64 pixel OLED display running on the
66

77
You can either download this library as a zip file and unpack it to your Arduino/libraries folder or (once it has been added) choose it from the Arduino library manager.
88

9+
It is also available as a platformio library. Just execute the following command:
10+
```
11+
platformio lib install 562
12+
```
13+
914
## Credits
10-
Many thanks go to Fabrice Weinberg (@FWeinb) for optimizing and refactoring the UI library.
15+
This library has initially been written by Daniel Eichhorn (@squix78). Many thanks go to Fabrice Weinberg (@FWeinb) for optimizing and refactoring the UI library. Also many thanks to the many committers who helped add new features and fix bugs.
1116
The init sequence for the SSD1306 was inspired by Adafruit's library for the same display.
1217

1318
## Usage
1419

15-
The SSD1306Demo is a very comprehensive example demonstrating the most important features of the library.
20+
Check out the examples folder for a few comprehensive demonstrations how to use the library. Also check out the ESP8266 Weather Station library (https://github.com/squix78/esp8266-weather-station) which uses the OLED library to display beautiful weather information.
1621

1722
## Features
1823

@@ -73,9 +78,6 @@ SSD1306Spi display(RES, DC, CS);
7378
### Display Control
7479
7580
```C++
76-
// Create the display object connected to pin sda and sdc
77-
SSD1306(int i2cAddress, int sda, int sdc);
78-
7981
// Initialize the display
8082
void init();
8183
@@ -116,7 +118,10 @@ void flipScreenVertically();
116118
## Pixel drawing
117119

118120
```C++
119-
void setColor(SSD1306_COLOR color);
121+
122+
/* Drawing functions */
123+
// Sets the color of all pixel operations
124+
void setColor(OLEDDISPLAY_COLOR color);
120125

121126
// Draw a pixel at given position
122127
void setPixel(int16_t x, int16_t y);
@@ -130,14 +135,24 @@ void drawRect(int16_t x, int16_t y, int16_t width, int16_t height);
130135
// Fill the rectangle
131136
void fillRect(int16_t x, int16_t y, int16_t width, int16_t height);
132137

138+
// Draw the border of a circle
139+
void drawCircle(int16_t x, int16_t y, int16_t radius);
140+
141+
// Fill circle
142+
void fillCircle(int16_t x, int16_t y, int16_t radius);
143+
133144
// Draw a line horizontally
134145
void drawHorizontalLine(int16_t x, int16_t y, int16_t length);
135146

136-
// Draw a line vertically
147+
// Draw a lin vertically
137148
void drawVerticalLine(int16_t x, int16_t y, int16_t length);
138149

150+
// Draws a rounded progress bar with the outer dimensions given by width and height. Progress is
151+
// a unsigned byte value between 0 and 100
152+
void drawProgressBar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t progress);
153+
139154
// Draw a bitmap in the internal image format
140-
void drawFastImage(int16_t x, int16_t y, int16_t width, int16_t height, const char* image);
155+
void drawFastImage(int16_t x, int16_t y, int16_t width, int16_t height, const char *image);
141156

142157
// Draw a XBM
143158
void drawXbm(int16_t x, int16_t y, int16_t width, int16_t height, const char* xbm);
@@ -157,6 +172,9 @@ void drawStringMaxWidth(int16_t x, int16_t y, int16_t maxLineWidth, String text)
157172
// font settings
158173
uint16_t getStringWidth(const char* text, uint16_t length);
159174
175+
// Convencience method for the const char version
176+
uint16_t getStringWidth(String text);
177+
160178
// Specifies relative to which anchor point
161179
// the text is rendered. Available constants:
162180
// TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER_BOTH

0 commit comments

Comments
 (0)