diff --git a/README.md b/README.md index eb175a5722715b361ff709369ae628e5230b0939..13b950c8a16fceb7dd9a6c6bdb46dc686b2143f9 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ This is a driver for the SSD1306 based 128x64 pixel OLED display running on the 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. +## Credits +Many thanks go to Fabrice Weinberg (@FWeinb) for optimizing and refactoring the UI library. +The init sequence for the SSD1306 was inspired by Adafruits library for the same display. + ## Usage The SSD1306Demo is a very comprehensive example demonstrating the most important features of the library. @@ -24,7 +28,11 @@ The SSD1306Demo is a very comprehensive example demonstrating the most important ## Fonts -Fonts are defined in a proprietary but open format. I wrote a program that converts any TrueType font into this format. Once the code is useful enough I will publish it or make it available as Webapplication (SaaS), where you can make any font you like available to the library. +Fonts are defined in a proprietary but open format. You can create new font files by choosing from a given list +of open sourced Fonts from this web app: http://oleddisplay.squix.ch +Choose the font family, style and size, check the preview image and if you like what you see click the "Create" button. This will create the font array in a text area form where you can copy and paste it into a new or existing header file. + + ## API @@ -84,10 +92,10 @@ void drawRect(int x, int y, int width, int height); void fillRect(int x, int y, int width, int height); // Draw a bitmap with the given dimensions -void drawBitmap(int x, int y, int width, int height, const char *bitmap); +void drawBitmap(int x, int y, int width, int height, const char ∗bitmap); // Draw an XBM image with the given dimensions -void drawXbm(int x, int y, int width, int height, const char *xbm); +void drawXbm(int x, int y, int width, int height, const char ∗xbm); // Sets the color of all pixel operations void setColor(int color); @@ -116,17 +124,18 @@ void setTextAlignment(int textAlignment); // Sets the current font. Available default fonts // defined in SSD1306Fonts.h: // ArialMT_Plain_10, ArialMT_Plain_16, ArialMT_Plain_24 -void setFont(const char *fontData); +// Or create one with the font tool at http://oleddisplay.squix.ch +void setFont(const char ∗fontData); ``` ## Frame Transition Functions -The Frane Transition functions are a set of functions on top of the basic library. They allow you to easily write frames which will be shifted in regular intervals. The frame animation (including the frame indicators) will only be activated if you define callback functions with setFrameCallacks(..). If no callback methods are defined no indicators will be displayed. +The Frame Transition functions are a set of functions on top of the basic library. They allow you to easily write frames which will be shifted in regular intervals. The frame animation (including the frame indicators) will only be activated if you define callback functions with setFrameCallacks(..). If no callback methods are defined no indicators will be displayed. ```C++ // Sets the callback methods of the format void method(x,y). As soon as you define the callbacks // the library is in "frame mode" and indicators will be drawn. -void setFrameCallbacks(int frameCount, void (*frameCallbacks[])(int x, int y)); +void setFrameCallbacks(int frameCount, void (∗frameCallbacks[])(SSD1306 ∗display, SSD1306UiState∗ state,int x, int y)); // Tells the framework to move to the next tick. The // current visible frame callback will be called once diff --git a/resources/FontTool.png b/resources/FontTool.png new file mode 100644 index 0000000000000000000000000000000000000000..c7bb222bed6067b921d8a3e479b56e4981a185d4 Binary files /dev/null and b/resources/FontTool.png differ