Giter Club home page Giter Club logo

lcdgfx's Introduction

LCDGFX library for display controllers

Github actions Coverage Status Doc Status GitHub

Introduction

lcdgfx driver is C++ library with unicode support. The library can be compiled for plain Linux (for example, raspberry spi), or you can use it with plain avr-gcc compiler without Arduino IDE. It supports monochrome and RGB oleds and has debug mode, allowing to execute code on Linux, Windows and macOS, using SDL2.0. The library is intended to run on small microcontrollers. It is developed to use as few resources as possible, but still has powerful capabilities (NanoEngine), allowing to develop nice animation. It works also on any powerful devices like raspberry pi, esp32; and can be easily ported to new platform. This library integrates another library canvas

Documentation

For more information about this library, please, visit https://github.com/lexus2k/lcdgfx. Documentation generated by doxygen tool can be found at codedocs xyz site. The library provides numerous usage examples.

Easy to use

Example:

DisplayST7735_128x160x16_SPI display(3,{-1, 4, 5, 0,-1,-1});

void setup()
{
    display.begin();
    display.clear();
}

void loop()
{
    display.setColor(RGB_COLOR16(255,255,0));
    display.drawLine(10,30,56,96);
}

Key Features

  • Supports color, monochrome OLED displays
  • The library has modular structure, and some modules can be excluded from compilation at all to reduce flash usage.
  • Very small footprint ( Draw text example uses only 5KiB of Flash with I2C code, display code, font!!! and application itself. Examples without fonts start at 2.5KiB of Flash )
  • Very small RAM consumption ( Attiny85 with Damellis package needs minimum 30 bytes of RAM to communicate with OLED )
  • Fast implementation to provide reasonable speed on slow microcontrollers
  • Supports i2c and spi interfaces, allows to implement custom interfaces:
    • i2c (software implementation, Wire library, AVR Twi, Linux i2c-dev)
    • spi (4-wire spi via Arduino SPI library, AVR Spi, AVR USI module)
  • Primitive graphics functions (lines, rectangles, pixels, bitmaps, drawing canvas)
  • Printing text to display (using fonts of different size, How to add new fonts, Useful tools)
  • Includes graphics engine to support double buffering on tiny microcontrollers.
  • Can be used for game development (bonus examples):

Image of arkanoid intro Image of lode runner

Image of menu example Image of color oled

The i2c pins can be changed via API functions. Please, refer to documentation. Keep in mind, that the pins, which are allowed for i2c or spi interface, depend on the hardware. The default spi SCLK and MOSI pins are defined by SPI library, and DC, RST, CES pins are configurable through API.

Setting up

i2c Hardware setup is described here

Setting up for Arduino from github sources)

Setting up for Arduino from Arduino IDE library manager

  • Install lcdgfx library (named lcdgfx by Alexey Dynda) via Arduino IDE library manager

Using with plain avr-gcc:

  • Download source from https://github.com/lexus2k/lcdgfx
  • Build the library (variant 1)
    • cd lcdgfx/src && make -f Makefile.avr MCU=<your_mcu>
    • Link library to your project (refer to Makefile.avr in examples folder).
  • Build demo code (variant 2)
    • cd lcdgfx/tools && ./build_and_run.sh -p avr -m <your_mcu> ssd1306_demo

For esp32:

  • Download source from https://github.com/lexus2k/lcdgfx
  • Put downloaded sources to components/lcdgfx/ folder.
  • Compile your project as described in ESP-IDF build system documentation

For more information about this library, please, visit https://github.com/lexus2k/lcdgfx. Doxygen documentation can be found at Codedocs xyz site. If you found any problem or have any idea, please, report to Issues section.

Supported displays:

Display I2C SPI Orientation Comments
sh1106 128x64 X X
sh1107 128x64 X X
sh1107 64x128 X X
ssd1306 64x32, 64x48, 128x64, 128x32 X X
ssd1325 128x64 X X
ssd1327 128x128 X X
ssd1331 96x64 X X
ssd1351 128x128, 96x96 X X
il9163 128x128 X X please, don't forget to connect backlight
st7735 128x160, 80x160, 128x128 X X please, don't forget to connect backlight
st7789 135x240 X X please, don't forget to connect backlight
ili9341 240x320 X X please, don't forget to connect backlight
pcd8544 84x48 X Nokia 5110
any other custom Refer to custom display example

Supported platforms

Compilers: gcc, clang

Platforms I2C SPI Comments
Arduino
Wio Terminal X X by SeeedStudio
Attiny85, Attiny45 X X Refer to Damellis attiny package
Attiny84, Attiny44 X X Refer to Damellis attiny package
Atmega328p, Atmega168 X X
Atmega32u4 X X
Atmega2560 X X
Digispark, including PRO version X X check examples compatibility list
ESP8266 X X check examples compatibility list
ESP32 X X check examples compatibility list
STM32 X X stm32duino
Arduino Zero X X
Nordic nRF5 (nRF51, nRF52) X X via Standard Arduino nRF52 boards. nRF users, enable c++11 in platform.txt -std=gnu++11
Nordic nRF5 (nRF51, nRF52) X X via Sandeep Mistry arduino-nRF5 package
Wio Terminal X X Wio Terminal
TTGO T-Display X LilyGo TTGO
Plain AVR
Attiny85, Attiny45 X X
Atmega328p, Atmega168 X X
Atmega32u4 X X
Plain ESP32 IDF
ESP32 X X library can be used as IDF component
TTGO T-Display X
Plain ESP8266
ESP8266 X X library can be used as IDF RTOS component
Linux
Raspberry Pi X X i2c-dev, spidev, sys/class/gpio
SDL Emulation X X demo code can be run without real OLED HW via SDL library
macOS
SDL Emulation X X demo code can be run without real OLED HW via SDL library
Windows
SDL Emulation X X demo code can be run without real OLED HW via MinGW32 + SDL library

Digispark users, please check compilation options in your Arduino prior to using this library. lcdgfx library requires at least c++11 and c99 (by default Digispark package misses the options -std=gnu11, -std=gnu++11).

Useful tools

Tim's Image Pixel Editor This is a little application made by Tim Jackson to edit and create Images and fonts for the small monochrome displays.

Built-in font generator Lcdgfx library has built-in Python script to generate lcd fonts from ttf files.

Font format converter from bdf fonts by mayopan Font format converter that converts bdf font to lcdgfx c style free

Projects using lcdgfx

The goals of lcdgfx library

  • To use as few RAM as possible
  • To use as few Flash as possible
  • To be as fast as possible
  • To fit Arkanoid game example to Attiny85 microcontroller

License

The library is free. If this project helps you, you can give me a cup of coffee.

MIT License

Copyright (c) 2016-2022, Alexey Dynda

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

lcdgfx's People

Contributors

cwl769 avatar danixu avatar dlitz avatar enekochan avatar gaaf avatar lexus2k avatar miguelbarro avatar simon-77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lcdgfx's Issues

SH1107 support

Is this library supporting the SH1107? I see the SH1106 is already implemented.

Cyrillic characters are not displayed correctly

Good afternoon!
I need to display Russian text.
I am trying to use the free_calibri11x12_cyrillic font from your library kit.
The test code is very simple.

#include "lcdgfx.h"
DisplaySSD1306_128x64_I2C display(-1);
// DisplayIL9163_128x128x16_SPI display(3,{-1, 4, 5, 0,-1,-1}); // Use this line for Atmega328p
void setup()
{
display.begin();
display.fill(0x00);
display.setFixedFont( free_calibri11x12_cyrillic );
display.printFixed (11, 32, "ААААА", STYLE_NORMAL );
}
void loop()
{
}

But I get unreadable characters on the screen. Photo attached. I tried the same on the IL9163 display, but the result was the same.

https://www.dropbox.com/s/lhej8to9mt0va8r/IMG_20200407_102752.jpg?dl=0

I am using an Arduino UNO board with SSD1306 and IL9163 displays for the test. All demos from your library compile fine and work well

SSD1327 – implement BOLD and SIZE_2X?

I have been using display.printFixedN(... FONT_SIZE_2X) and display.printFixed(..., STYLE_BOLD) with the SSD1306. However, with the larger SSD1327 this seems not to work. In short: It would be helpful when using using DisplaySSD1327_128x128_I2C display(-1) constructor such functionality can be used.

As a compromise, I now use ssd1306xled_font8x16 in combination with ssd1306xled_font6x8 on the SSD1327, but the larger 8x16 font looks quite different in style, and cannot be made bold. A pity as this larger display would benefit from these features and its quite elegant implementation.

Now I am not sure if there is an easy fix, or not at all – but I thought to bring it up in any case!

Can't get it to compile - can you help?

Tried both from the Library Manager and cloned from GitHub; with the latter it looks like this:

/usr/share/avr/bin/avr-ld: /tmp/cct12l2x.ltrans0.ltrans.o: in function `NanoEngineInputs::ky40Buttons()':
/home/jrs/Arduino/libraries/lcdgfx/src/v2/nano_engine/core.cpp:141: undefined reference to `NanoEngineInputs::s_ky40_clk'
/usr/share/avr/bin/avr-ld: /home/jrs/Arduino/libraries/lcdgfx/src/v2/nano_engine/core.cpp:141: undefined reference to `NanoEngineInputs::s_ky40_clk'
/usr/share/avr/bin/avr-ld: /home/jrs/Arduino/libraries/lcdgfx/src/v2/nano_engine/core.cpp:141: undefined reference to `NanoEngineInputs::s_ky40_dt'
/usr/share/avr/bin/avr-ld: /home/jrs/Arduino/libraries/lcdgfx/src/v2/nano_engine/core.cpp:141: undefined reference to `NanoEngineInputs::s_ky40_sw'
/usr/share/avr/bin/avr-ld: /tmp/cct12l2x.ltrans0.ltrans.o: in function `NanoEngineInputs::connectKY40encoder(unsigned char, unsigned char, signed char)':
/home/jrs/Arduino/libraries/lcdgfx/src/v2/nano_engine/core.cpp:133: undefined reference to `NanoEngineInputs::s_ky40_clk'
/usr/share/avr/bin/avr-ld: /home/jrs/Arduino/libraries/lcdgfx/src/v2/nano_engine/core.cpp:133: undefined reference to `NanoEngineInputs::s_ky40_dt'
/usr/share/avr/bin/avr-ld: /home/jrs/Arduino/libraries/lcdgfx/src/v2/nano_engine/core.cpp:133: undefined reference to `NanoEngineInputs::s_ky40_sw'
collect2: fatal error: ld returned 1 exit status
compilation terminated.
exit status 1
Error compiling for board Arduino Nano.

My only code so far was:

#include "lcdgfx.h"

void setup(){}
void loop(){}

Using <lcdgfx.h> instead of the quotation marks also doesn't help :-(. FWIW, going into the lcdgfx folder, changing Makefile to have ARCH ?= avr and running make doesn't produce any errors at all. And from the Arduino IDE, I've never had any problems with compiling libraries before...

Specify offset/size for menu

Thankyou for this library - it seems robust and very well-documented. I particularly like the built-in scrolling menu capability.
However, I'm using a (relatively common, I believe) 128x64 "yellow/blue" OLED display based on the SSD1306. Essentially, it's a monochrome display, but the top 16 rows are yellow, while the bottom 48 pixels are blue (like this http://www.embeddedadventures.com/oled_display_128x64_OLED-12864-YB.html)
It looks very ugly when the menu changes colour halfway down the screen, so I'd like to specify that the menu should only occupy the bottom 48 pixels - leaving the top 16 rows free to draw a separate topbar on the canvas.

I imagine this could be achieved relatively easily as a function overload to the showMenu() and drawMenuItem functions, specifying additional optional parameters for desired x, y, width and height? They seem to currently have hardcoded values.

Adding brightness support to SSDXXXX

I'm using a SSD1531 display and the LCDGFX with a ESP32 and the linux simulator, with a lot of fun... Your lib is really good. :)

I can't see support to set the brightness of the display.... I would like to get it.

I'm glad to offer my support to add it but I would like you to show me where to start, It will be easier and I will be sure that I put the function in the good Class.

thank you.

putPixel deletes Pixels

the putPixel method of the NanoDisplayOps4 class does not allow to draw directly neighboring pixels. A full line appears as dotted line. (See code below)

drawLine(30,60,60,60) has the same issue, drawing a dotted line.

drawHLine(40,70,8) works as expected, drawing a solid line

Thanks
Norbert

`#include "lcdgfx.h"

DisplaySSD1327_128x128_SPI display(3, { -1, 4, 5, 0, -1, -1}); // Use this line for Atmega328p (3=RST, 4=CE, 5=D/C)

void setup() {
display.begin();
display.fill(0x00);

}

void loop() {

for (int i = 0; i < 8; i++) {
display.putPixel(64 + i, 61);
delay(500);
}
}`

Rotate 180 degrees a SSD1306 oled on RPI

Hello, I am starting using this amazing library, I am not an expert in cpp but a need to use it.
This simple example works as expected but the board I am using has the oled physically rotated 180 degrees, so I need to rotate it but I dont know how to do it. I believe it is a matter of cpp knowledge. I need to overcome this issue to follow with my tests. I'd really appreciate your help.

Thank you very much.

int main(int argc, char **argv)
{
DisplaySSD1306_128x64_I2C display((int8_t) 5, { -1, 0x3D, -1, -1, 0 });
display.begin();
display.clear();
display.drawLine(10,10,50,10);
display.setFixedFont(ssd1306xled_font6x8);
display.printFixed (0, 8, "Line 1. Normal text", STYLE_NORMAL);
cout << "Finished!, press any key to continue" << endl;
cin.get();
return EXIT_SUCCESS;
}

GUI Menu and sub-menus

Before I proceed, I'm a beginner in terms of programming so I might used incorrect programming terms. Anyways, I'm making a little device that needs a simple UI library. I managed to create the main menu but it's difficult to create submenu. At first, I tried to create a multidimensional array and then cycle through the "pages" but I don't think the menu gets updated. I'm at a lost. My current solution is to create multiple LcdGfxMenu object and manually do the logic so it displays ontop which gets tedious as the submenu grows.

const char *menuPG[][4] =
{
    { "Main 1", "Main 2", "" ,  ""},                   //Main menu
    { "Sub 1", "Sub 2", "Sub 3", "Back"},        //Submenu Page 1
    { "Sub 1", "Sub 2", "Sub 3", "Back"},       //Submenu Page 2
};
uint8_t curPAGE= 0;
SAppMenu menu;

void setup()
{
    display.begin();
    display.clear();
    display.setFixedFont(ssd1306xled_font6x8);
    display.createMenu(&menu, menuPG[curPAGE], sizeof(menuPG[curPAGE]) / sizeof(char *), {0,9} );  

   /* The only way for a submenu to work is manually calling each submenu below to override the previous */                               
    //display.createMenu(&set_up, set_upPG, sizeof(set_upPG) / sizeof(char *) );
    //display.createMenu(&sensors, sensorPG, sizeof(sensorPG) / sizeof(char *), {82, 36, 127, 64} );
    //display.createMenu(&about, aboutPG, sizeof(aboutPG) / sizeof(char *) );
    display.showMenu(&menu);
}

void loop()
{
    curPAGE ++;
    display.updateMenu(&menu);
    display.showMenu(&menu);
    delay(1000);
}

Is there a way to create a submenu system? I'm currently using Adafruit nrf52 Feather bluefruit and SSD 1306 0.96" mono. Thanks.

Where can I find the API documentation?

I'm sure this is poor search-engine foo on my part (or some other dumb error), but I'm having a devil of a time finding a basic reference for the API or tutorial to let me just make basic use of the library.

I found the FAQs, I found how to add fonts, I found how to set up the hardware (though I had the hardware running the demo before I went looking), I found how to instantiate the class, and I understand from reviewing the source to the demo how to do some basic operations in the code. I even found the list of available fonts.

What I haven't found is any sort of API documentation or reference.

Pointer appreciated.

Update of FAQ and other READMEs to include this pointer very much appreciated.

Updating "Arduino SAMD Boards" package to 1.8.10 has broken compilation

Describe the bug

The update of the "Arduino SAMD Boards" package to 1.8.10 (Arduino IDE) seems to have broken compilation for the lcdgfx library ("fatal error / compilation terminated" – see below). Downgrading to package 1.8.9 removes the compiler error. Upgrading to 1.8.10 re-instates the error.

To Reproduce
Steps to reproduce the behavior:

  1. Update to "Arduino SAMD Boards" 1.8.10 in Arduino IDE
  2. Click 'Compile' in IDE
  3. Compiler terminates:
    "…/Arduino/libraries/lcdgfx/src/lcd_hal/arduino/io.h:42:14: fatal error fatal error: avr/pgmspace.h: No such file or directory
    #include <avr/pgmspace.h>
    ^~~~~~~~~~~~~~~~
    compilation terminated.
    exit status 1
    Error compiling for board Arduino MKRZERO."

Expected behavior
Expected: no compiler error (as confirmed with SAMD Board package 1.8.9)

Screenshots
n/a

Please complete the following information:

  • library version: 1.0.6 (latest, Github)
  • LCD display type: ssd1306 128x64
  • OS: MacOS 11.1
  • Platform: MKR Zero
  • Arduino IDE 1.8.14 Hourly Build 2020/12/01

Additional context
n/a

SSD1327 128x128 I2C some fonts crippled

Describe the bug
I use a Waveshare 128x128 monochrome OLED connected (and jumpered) via I2C at a Arduino Nano (old bootloader). The display works fine when explicitely using the display I2C address (0x3D in my case). However, some fonts displayed crippled when using the NanoEngine library.

To Reproduce
Steps to reproduce the behavior:

  1. Connect the 1.5inch OLED to A4 and A5 at the Nano board
  2. Open menu demo sketch from the library
  3. Choose NanoEngine1 as engine
  4. Select e.g. "free_calibri11x12" font

Expected behavior
I would expect that every font will be displayed nicely.

Screenshots
IMG_20200216_135942
IMG_20200216_135450

Please complete the following information:

  • library version: 1.0.2
  • LCD display type: Waveshare 1.5inch monochrome OLED
  • Platform: Atmega328p
  • IDE: PlatformIO and Arduino 1.8.11

Additional context
Sometimes, but not always, this works fine when using NanoEngine4 or NanoEngine8:

IMG_20200216_135523

SSD1351 Screen orientation

Can anyone point me in the direction of adding screen orientation support for the Waveshare SSD1351 RGB OLEDs? I need it for a project of mine.

Or if it's not possible as there is some hardware limitation that would be good to know.

I tried playing around with the library by going off the other screen orientation functions but haven't been able to make any progress.

Added macOS support in emulation mode

I've added support for emulation in macOS. The code if you want to check it out: https://github.com/enekochan/lcdgfx

I'll do a PR if you consider this appropriate.

Basically I've installed SDL 2.0 with MacPorts (but you could use Brew or the original SDL 2 code as long as you use CFLAGS to include the headers folder location), added/changed some Makefiles and put some defined(__APPLE__) in the LCD HAL code.

I added the new defined(__APPLE__) statements in the original src/lcd_hal/linux code because everything is the same but for Linux Kernel I2C and SPI devel header references (that are not included in macOS). If a new folder with src/lcd_hal/mac should be created just tell me.

Some new docs should be added too in the Wiki. The process should be something like this:

sudo port install libsdl2
cd tools/sdl
make -f Makefile.mac CFLAGS=-I/opt/local/include/
cd ../../src
make -f Makefile.mac SDL_EMULATION=y
cd ../tools
./build_and_run.sh -p mac -e -f demos/ssd1306_demo
./build_and_run.sh -p mac -e -f games/arkanoid8

If you install SDL from source CFLAGS=-I/opt/local/include/ wont needed because it will most probably be located in /usr/local/include/ and directly included.

I've also fixed some Makefile and Markdown errors (the build folder was not always created and links in the TOC section wouldn't work).

fontgenerator.py fails with exception

I'm trying to convert a font using the included fontgenerator tool. I tried it on my Mac as well on a Debian 10 installation, using python 2.7 and also python 3.

Every time I try to convert a font the following error occurs

python2.7 fontgenerator.py --ttf NiceFont-Medium.ttf -s 12 -d -f new > ~/Desktop/nice_font-12.h
Password:
Traceback (most recent call last):
  File "fontgenerator.py", line 151, in <module>
    source = ttfsource.TTFSource(fname, fsize)
  File "Arduino/libraries/lcdgfx/tools/modules/ttfsource.py", line 45, in __init__
    self.face = freetype.Face( filename )
  File "/Library/Python/2.7/site-packages/freetype/__init__.py", line 991, in __init__
    raise FT_Exception(error)
freetype.ft_errors.FT_Exception: FT_Exception:  (cannot open resource)

I first thought it might be a permission issue, but I tried it with sudo as well. Then I assumed it was one of the funny Apple things and switched to my Debian installation which failed in exactly the same manner.

How to set font size on canvas?

Hi.

I am trying to write some screens on a SSD1306 (128_32) and to avoid screen flickering I am trying to use double buffering by writing all my display code to draw on a canvas, as per your monochrome double buffering example.

However I cant seem to find a way to set the font size when drawing to a canvas.

Is this not supported?

ssd1306_demo not working on ESP32

Hello there!
I´m trying to use the demo with ESP32 (DOIT devkit) but nothing shows up on the oled screen. If I use your C library (SSD1306) with the same circuit, works like charm.
Any ideas to test?

Thank you in advance!

Getting to work with ESP IDF Master & CMake

Hi, first time I am trying to use your library with ESP-WROVER-KIT using ILI9341 controller and 240x320 display.

I am proficient with the ESP IDF using v4.2 (master) and reasonably so with CMake but primarily with C and less so C++. What confuses me is your various repos (canvas vs lcdgfx) and the duplication of code between them. To get the simplest possible demo of text only functionality and with the 9341 controller going, where to I start, ie:
Do I start with canvas or lcdgfx?
How do I select the ILI9341 support?
How to I select the GPIO pins for the SPI interface on the ESP-WROVER-KIT ?
Which example files shall I copy from into my GUI task to replace the setup() and loop() components?
Anything to help me get going ASAP with the basic text functionality?

All help appreciated

Andre

Live updating ssd1306 from camera frames

Hi,

I need some pointers on how to display the frame buffer from an ESP32 camera on an OLED ssd1306 screen.

The ESP32 camera can output BMP and JPEG frames. I would prefer to use JPEG because I want to save images as well.

Maybe I could use a jpeg decoder and something like this to reduce it down https://www.reddit.com/r/esp8266/comments/ci1zbg/best_way_to_convert_images_on_esp8266_or_esp32/evadar5/ and somehow convert it to the format used by drawBitmap1?

Alternatively, maybe I could convert this to C: https://github.com/robertgallup/python-bmp2hex/blob/master/bmp2hex.py

Thanks.

Problem displaying RGB .bmp

For some reason when I am trying to call display.drawBitmap16() and pass in my converted .bmp file I am not seeing the images in the correct color on the screens. I have some SSD1351 OLEDs which displays colored fonts fine when I use display.setColor() and pass in RGB_COLOR(XXX, XXX,XXX). The RGB images being displayed seem to end up shifted or switched.

For reference here is a converted image that I have created it in Photoshop using RGB mode with 8Bits/channel and saved in 565 format as required in the docs.

I convert the .bmp files using bmp2hex which outputs the following struct, I did slightly alter the output as they originally output the pixel data as a uint8_t *pixel_data which wasn't right for this library.

PROGMEM const struct {
  unsigned int   width;
  unsigned int   height;
  unsigned int   bitDepth;
  uint8_t pixel_data[1250];
} RGBTEST = {
25, 25, 16, {
0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8,
0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8,
0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8,
0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8,
0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8,
0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8,
0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8,
0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8,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 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00,
0x1f, 0x00
}
};

//Display my image
display.drawBitmap16(0, 0, RGBTEST.width, RGBTEST.height, RGBTEST.pixel_data);

Here is what I see in Photoshop:

RGB

and here is what it looks like on my screen:

BRG

I've tried looking in the library to see if there is somewhere I need to specify the RGB order, or other similar image requirements but I am scratching my head over this. I have some more complex images I would like to display on screen which would be very difficult to alter in a way to fudge them into looking correct on the screen so I am hoping someone can let me know if maybe I am doing something wrong.

SH1106 not working..

I tried to flash an example for SH1106 and the display just stay black all the time after flashing. If I flash the same example for SSD1306 it works, but corrupted because I have SH1106. Im using Arduino Micro with Atmega32u4.

SSD1327 128x128 ESP32

Hello, I can't seem to make my SSD1327 (i2c) display work with my ESP32 board, either with this or the u8g2 library.

I'm using this line to set the display up :
DisplaySSD1327_128x128_I2C display(-1);

Does anyone has an idea ? I'm starting to think of a hardware failure...

display.drawBitmap16 should use uint16_t

Hi Aleksei

Thank your your work with this great library.

This is not a bug by definition but IMHO not the correct behavior.

Most of the 565 converters are using uint16 for output. The display.drawBitmap16 function expects uint8. This requires a conversation of the convertes output. It's not a big deal but somewhat annoing if you are working with a lot of icons and bitmaps.

Can you have a look on this topic?

Thank you,

Best regards,

Andy

Definition of pins for the SPI

Hi! I am trying to use this lib with my new display over SPI. Somehow after digging through the examples or documentation I cannot understand the how are the hardware pins defined (in this call:
DisplaySH1106_128x64_SPI display(3,{-1, 4, 5, 0,-1,-1}); // Use this line for Atmega328p (3=RST, 4=CE, 5=D/C)
I assume there are pin numbers in here but what is the layout of this command (the documentation is unclear for me about this matter)
BR

SSD1331 support with HSPI on AI THINKER ESP32 CAM

Hi,
Is HSPI supported? How do I set it is supported?
I wasn't able to get the HSPI on the AI Thinker esp32-cam board to work with the OLED SSD1331
with following setting. (not using the SDcard slot)
DisplaySSD1331_96x64x8_SPI display(0,{0, 3, 15, 0,-1,-1}); rst =0, busID=0, cs=3,dc=15
The VSPI on ESP32 is working fine with the OLED SSD1331 with the following setting.
DisplaySSD1331_96x64x8_SPI display(32,{-1, 33, 5, 0,-1,-1}); rst =32, busID=-1, cs=33,dc=5

Thanks in advance

Esp8266

ESP8266-RTOS-SDK support?

nano-engine not working as expected

Describe the bug
Full-screen double-buffering with NanoEngine is not possible. The following example from the README.md-file (ssd1306/src/nano_engine/README.md) is just not working:


//## What if not to use draw callbacks

// If you don't want to use draw callbacks in your application, but still need a power of NanoEngine, then there is one
// way for you: to use full-screen double-buffering with NanoEngine. The example, you will find below, shows how to
// use full-screen double buffering for monochrome 128x64 ssd1306 oled display. This example can be run on Atmega328p
// and more powerful micro controllers. It clears back-buffer every time engine says to redraw the frame. But you can
// preserve previously prepared image by removing call to `engine.canvas.clear()`.

#include "ssd1306.h"
#include "nano_engine.h"

//NanoEngine<BUFFER_128x64_MONO> engine; // compile-error: BUFFER_128x64_MONO not found
NanoEngine8 engine; //Sketch compiles with this

void setup()
{
    // Init SPI 128x64 monochrome oled.
    // 3 - RESET, 4 - CS (can be omitted, oled CS must be pulled down), 5 - D/C
   //  ssd1306_128x64_spi_init(3, 4, 5); // deactivated becaus I use a different LCD
   st7735_128x160_spi_init (8, 10, 9);

    engine.begin();
    engine.setFrameRate(30);
}

void loop()
{
    if (!engine.nextFrame()) return;
    engine.canvas.clear();    // This step can be removed, if you don't want to clear buffer
    engine.canvas.drawRect(15,12,70,55);
    engine.display();

Expected behavior
A rectangle should be drawn onto the screen. Instead, there is a black box in the top-left corner.

Please complete the following information:

  • library version: lcdgfx by Alexey Dynda 1.0.5
  • LCD display type: st7735 with a resolution of 128x160 pixel and SPI-connection
  • Platform: Arduino Nano with an Atmega328p (old version)
  • IDE: Arduino-IDE on Ubuntu

Additional context
I also have problems using conditional statements in the draw-callback-function for the nano-engine. Draw-commands inside conditional statements dont get executed.
I placed a full description of my problem on the arduino-forums.

Example lode_runner_ili9341.ini don't compile, missing method setRotation

Using Arduino 1.8.13 IDE the example lode_runner_ili9341.ini don't compile when line 286 is uncommented to enable display rotation.

Error:

/tmp/arduino_modified_sketch_394812/lode_runner_ili9341.ino: In function 'void setup()':
lode_runner_ili9341:286:13: error: 'GraphicsDisplay {aka class DisplayILI9341_240x320x16_SPI}' has no member named 'setRotation'
     display.setRotation(1);
             ^~~~~~~~~~~
exit status 1
'GraphicsDisplay {aka class DisplayILI9341_240x320x16_SPI}' has no member named 'setRotation'

Using:

  • library version : 1.0.5
  • LCD display type: ili9341
  • OS: linux
  • Platform: Atmega328p
  • IDE: Arduino 1.8.13

setOffset does not seem to work?

Hi,

I am working on a project that requires some LCD interaction, so after searching for alternatives for the Adafruit LCD libraries I stumbled upon LCDGFX. After some research, I got it to work in my setup: An NodeMCU V3 ESP8266 with an 128x160 ST7735 Lcd screen. It is connected with an SPI connection.

After adjusting the code it seems to work fine, displaying everything I want in the correct colors. Running the Snowflake demo is fun! Except... The screen area falling off the screen with 1px or 2px both on X and Y axis. I've seen this happening too with other libraries, but they often supply an offset function to fix this which has been working fine with other libraries.

I see that LCDGFX also has an setOffset() method, but calling display.setOffset(1, 2); doesn't seem to have have any effect. This is about as less code as I could create:

#include "lcdgfx.h"

#define TFT_CS         D3
#define TFT_RST        D4                                            
#define TFT_DC         D2

DisplayST7735_128x160x16_SPI display(TFT_RST,{-1, TFT_CS, TFT_DC, 0,-1,-1});

void setup() {
  display.begin();
  display.setOffset(1, 2);
  display.clear();
  display.fill(0x000);
}

void loop() {
  
}

Which results in this:

IMG_2220

As you can see, an offset of 1px and 2px (guesstimate) would fix the random pixels near the edge. However, no matter what values I supply to display.setOffset(), I get the same result. Can you help me out? Am I doing something wrong?

I2C pins

Hello, and thank you foe this library.
I tried to look for a method but i can´t find anything.
How is the method to change i2c pins to work whit arduino Mega and ssd1327 128x128?

SSD1306 I2C freezes

Greetings from Argentina. I´m developing on ESP8266 platform. Sometimes I´ve noticed that the display freezes and the only way to make it work again is turn off and turn on again. The freezes sometimes correspond to ESP8266 firmware flashing or ESP8266 reset.
There is a way to reset the SSD1306 using I2C bus by software?

Thanks in advance and forgive my horrible english!

Which python version is compatible for fontgenerator?

Hello,

I'm trying to convert an Arial font just for testing, because I need some icons that are not in included fonts like for example ►. In the first attemp I've received an error saying that a library is missing, but after installing that library I get this error:

Traceback (most recent call last):
  File "C:\Users\danix\Desktop\Fuentes\fontgenerator.py", line 187, in <module>
    font.generate_new_format()
  File "C:\Users\danix\Desktop\Fuentes\modules\fontgenerator.py", line 117, in generate_new_format
    print("// char '%s' (0x%04X/%d)" % (char, ord(char), ord(char)))
  File "C:\Users\danix\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\x80' in position 9: character maps to <undefined>

I'm using python 3.9.1 on Windows, so that is why I want to ask the compatible versions, because I've only seen 2,7 and 3, but not if works in the latest.

Best regards, and thanks for this library. I was searching for a lightweight library for my project because the Adafruit library is very big.

printFixed y is limited to 8-pixel steps

Hi!

When using printFixed I'm limited to 8-pixel step for the y axis. Is there any way to display a font at a custom y location? I'm using the library with a SD1306_128x64_I2C.

Thank you!

how to rotate the screen with SSD1306/I2C

Sweet little library and especially the speed oposed to overloaded ones like the adafruit one.

Just wondering how one could rotate the screen (flip vertically and horizontally) using this library?
Is there any documentation of all exposed functions once can use on the display instance?
This library would be perfect if there was some more documentation available on the different functions

SH1107 128x64 offset and sideways

Using ESP32 with Adafruit OLED Featherwing display (SH1107 128x64 I2C).

lcdgfx library version 1.0.6

When running the sh1107_demo sketch from the example folder, image is rotated 90 degrees and only works in bottom right 64x32 pixels. Bottom left 64x32 pixels show a snowy pattern.

64x128 example works fine but screen is rotated and does not fit my needs that way.

Compiled using Arduino IDE 1.8.13 in Windows 10

20210224_141341

I made a font converter that converts bdf to free lcdgfx format.

Hi, lexus2k!
Thank you for the nice lcd driver. I like it rather than complex and huge Adafruit-GFX-Library.
I also like U8G2 driver that is a similar driver especially for monochrome displays.
It has a lot of fonts, but lcdgfx has a few.

So I made a font converter for your driver.

It converts bdf font to lcdgfx c style free (= proportional) font.
Now, I can use many bdf fonts!
Check it and if you like it, please add it in tool family for others.
Thanks.

FixedFont unicode\cyrillic

FIXED FONT is more convenient because when another inscription is displayed at the same place, the old text disappears. But I did not find an example of how to generate a unicode font for use with the display.setFixedFont function? Perhaps there is a ready-made cyrilic font, or an example of how to make such a font?

Parsing error with font file generated by GLCD Font Creator

Hi,

I'm getting a Parsing error when trying to convert a .glcd file from GLCD Font Creator using the fontgenerator.py script.

Here is my glcd file:

const unsigned short LC8x16[] = {
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char !
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char "
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char #
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char $
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char %
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char &
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char '
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char (
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char )
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char *
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char +
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char ,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char -
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char .
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char /
0x08, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF,  // Code for char 0
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,  // Code for char 1
0x08, 0x83, 0xFF, 0x83, 0xFF, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0xFF, 0xC1, 0xFF, 0xC1,  // Code for char 2
0x08, 0x03, 0xC0, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0xFF, 0xFF, 0xFF, 0xFF,  // Code for char 3
0x08, 0xFF, 0x0F, 0xFF, 0x0F, 0x00, 0x0C, 0x00, 0x0C, 0x80, 0xFF, 0x80, 0xFF, 0x00, 0x0C, 0x00, 0x0C,  // Code for char 4
0x08, 0xFF, 0xC1, 0xFF, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xFF, 0x83, 0xFF,  // Code for char 5
0x08, 0xFF, 0xFF, 0xFF, 0xFF, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xFF, 0x83, 0xFF,  // Code for char 6
0x08, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,  // Code for char 7
0x08, 0xFF, 0xFF, 0xFF, 0xFF, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0xFF, 0xFF, 0xFF, 0xFF,  // Code for char 8
0x08, 0xFF, 0xC1, 0xFF, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0x83, 0xC1, 0xFF, 0xFF, 0xFF, 0xFF,  // Code for char 9
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char :
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char ;
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char <
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char =
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char >
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char ?
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char @
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char A
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char B
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char C
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char D
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char E
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char F
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char G
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char H
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char I
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char J
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char K
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char L
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char M
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char N
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char O
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char P
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char Q
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char R
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char S
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char T
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char U
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char V
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char W
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char X
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char Y
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char Z
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char [
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char BackSlash
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char ]
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char ^
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char _
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char `
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char a
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char b
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char c
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char d
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char e
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char f
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char g
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char h
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char i
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char j
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char k
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char l
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char m
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char n
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char o
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char p
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char q
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char r
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char s
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char t
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char u
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char v
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char w
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char x
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char y
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char z
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char |
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char }
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char ~
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00   // Code for char �
};

Set different sizes on one Font

Hello,

I'm migrating from Adafruit library to this library to control an ST7735 display, because uses less RAM and Program space and my program need it.

My question is if is possible to use one font and change their size, because If not I will have to use two different fonts and uses more program memory. I've found that exists a function called printFixedN, but or I don't know how to use it, or is not available to my display.

Thanks!

positiveMode/ negativeMode and innitialization fails

Hi,
I am guessing it is a bug. I recompiled old code of mine which used to work fine now I am getiitng this:
'class DisplaySSD1306_128x64_I2C' has no member named 'negativeMode'

Have I missed any changes or has it been dorpped in the latest update?

Second issue not sure if again related to lcdgfx update when I turn it on first time it does not initialize display correctly I end up with randome pixles on the screen. When I turn power off and on it initializes correctly.

I am using the same hardware I used while back and the same arduino sketch but compiling in now gives me these two problems.

Thanks
Josef

displaying floating point numbers

Ask any question, you have, regarding the library
Appology for the newbie question, I am struggling to find way to display floating point number with lcdfgx, for example on serial you could do Serial.println(1.23456, 2) to get "1.23" displayed. I couldn't find anything in the demos I could use either. Any help will be greatly appreciated!

Render of space with free font

Thanks for writing and maintaining this great library - much appreciated. I did run into one problem: I generated a font from OpenSans and used printFixed() to display some text. However and space (0x20) character renders as previous character in the string. For example "Bold text" renders as "Bolddtext".

1) Generating the font

.\fontgenerator.py --ttf opensans.ttf -s 16 -g 0 127 -f new -d > output.cpp

2) Initializing the OLED

DisplaySSD1327_128x128_I2C display(-1);

3) Render the text (based on the example code)

{
    display.setFreeFont(free_opensans24x22);
    display.clear();
    display.setColor(GRAY_COLOR4(255));
    display.printFixed(0,  8, "Normal text", STYLE_NORMAL);
    display.setColor(GRAY_COLOR4(192));
    display.printFixed(0, 34, "Bold text", STYLE_BOLD);
    display.setColor(GRAY_COLOR4(128));
    display.printFixed(0, 60, "Italic text", STYLE_ITALIC);
    display.setColor(GRAY_COLOR4(164));
    display.invertColors();
    display.printFixed(0, 86, "Inverted bold", STYLE_BOLD);
    display.invertColors();
    delay(20000);
}

Result:

image

Set font character spacing

Hi,

First of all thank you for this great library! I was wondering if there is a way to set the font character spacing when using setFreeFont or setFixedFont ?

Thank you!

OLED 0,96 - problem with displaying a variable

Ask any question, you have, regarding the library
Hi. I'm trying to use the lcdgfx library to run a 0.96 64x128 OLED display with the SH1107 driver. I wanted to make a simple thermometer. The temperature is assigned to the float variable, but the display does not show it.
display.printFixed (0, 0, temp, STYLE_BOLD);

How do I enter such a code for example
display.printFixed (0, 0, "TEST", STYLE_BOLD);

The display works and shows TEST

Where is the problem? Please help.

Attiny84

Hello, i'm trying to make this work with an attiny84 , but i'm not able to. (with SSD1306).
The oled is working fine on a atmega328p
Working also with another library i found (ssd1306_minimal), but i wanted to try yours.

Tried DisplaySSD1306_128x64_I2C display(-1, { -1, 0x3C, 4, 6, 0 });
or DisplaySSD1306_128x64_I2C display(-1);

But nothing happens... i'd be glad if you could help;

Alexis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.