Giter Club home page Giter Club logo

ssd1306's Introduction

Hi there 👋

Primary

  • tinyproto - Protocol for fault-free communicating between microcontrollers over SPI, UART
  • lcdgfx - C++ style graphics library for different OLED and LCD displays.
  • ssd1306 - C style graphics library for different OLED and LCD displays.
  • nixie_clock - ESP32 C/C++ style firmware sources for Nixie Clocks.
  • nixie_hardware ESP32 hardware design for Nixie Clocks.
  • bot_trader - Telegram-controlled bot for trading system.
  • ArduPlc - HW and SW for Press Machine controller
  • uProfiler - C style profiler library for profiling remote systems: mcu/cpu

Software

  • telegram-bot - Simple telegram bot written in Python
  • audioplayer_esp32 - Audio I2S player for ESP32 C++
  • esp_ota_upgrade - ESP32 OTA upgrade module for upgrading via HTTPS
  • esp_ota_upgrade - ESP32 OTA upgrade module for upgrading via HTTPS
  • esp32_ram_logger - ESP32 RAM logger. Allows to retrieve latest logged data while working in normal mode
  • vgm_decoder - Decoder from NSF and VGM files to PCM format to play music from NES and MSX platforms. (Cross-platform)
  • tinyslip - SLIP protocol implementation.
  • libtftp - Lightweight TFTP server library

Hardware/RTL

Buy Me a Coffee at ko-fi.com

BTC ETH
BTC
3CtUY6Ag2zsvm1JyqeeKeK8kjdG7Tnjr5W
ETH
0x20608A71470Bc84a3232621819f578Fb9C02A460

ssd1306's People

Contributors

cromfr avatar drgallaci avatar isaacjt avatar jasxsl avatar lexus2k avatar matititam avatar minuswall avatar montaguk avatar robinvanemden avatar taubedonner 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ssd1306's Issues

problem with ssd1306 i2c rst pin

library version 1.7.3

I have problem to run my ssd1306 with i2c on arduino nano. It runs only with libraries dat have a rst setting.

Also. may be I have crooked hands coz im new in arduino

With Adafruit and OLED_i2c libraries display works well

console.print() issues

library version

1.7.8

LCD display type

i2c ssd1306

I can't figure out the console.

  console.clear();
  console.print("Temp : ");
  console.println(12);
  console.print("Humidity : ");
  console.println(34);

This outputs one line at the top of the screen, "Humidity : 34"

  console.clear();
  console.print("Temp : ");
  console.println(12);
  console.print("Humidity : \n");
  console.println(34);

This outputs "Humidity : (newline)34" and it scrolls down the screen, looping to the top after a hitting the bottom.

Problem after update

Please provide the following information:

library version > v1.35

LCD display type SSD1306 - 128 x 64 OLED

Before update the library (old one v1.35 - working)

Use Tiny_ssd1306.h and Tiny_ssd1306.cpp and i initialize the library with
oled.beginI2C(0, 2, 0x3C)

Expected behavior

Old library v1.35 work with attiny85 without problems

Actual behavior

New library after 1.35 don't display on OLED..... stay black.

How i can fix....
The example from new library (bigger version then 1.35 ) not working. Black screen
With v1.35 no problems with attiny85, the examples work without problems

thanks

Architectural improvements

It is more like a proposal to improve the NanoEngine rather than issue. I thought it might be great to have an ability to pass driver callbacks (via functors, function pointers, tagging/specialization, etc) or driver objects instead of calling "ssd1331_fastDrawBuffer16" or "ssd1306_drawBuffer" inside NanoCanvas implementation. The idea behind tiled rendering is very great, but it isn't very easy to port this lib to the other platform / display controller - it takes way too much unnecessary effort.

Text overwriting

I just noticed - that using the Canvas - if you write text.. then overwrite - the black pixels are not restored... ie overwrite an E with an O and the original pixels remain intact..

Which means the only way to update a line--- is to wipe the screen and redraw the lot?

samd21 port

I am trying to run this on the Adafruit feather M0 or on the Arduino Zero, but it won't compile
any idea how to get it running?
many thanks

Custom width canvas causes rows to shift left or right

Version 1.6.1
SSD1306 128x64 OLED

This is the section of code I've been having trouble with, according to the docs I should be able to create a NanoCanvas with any width so long as the height is divisible by 8, by from what I can tell any width value that isn't a power of two creates this shifting effect in the rows of bytes, the below code works fine if the width is something like 32 or 64, but anything in-between e.g. 48 and it bugs out like in the pictures below.

#include <ssd1306.h>
#include <nano_gfx.h>

uint8_t buffer[48*64/8];
NanoCanvas canvas(48, 64, buffer);

void setup() {
  Serial.begin(9600);
  
  ssd1306_128x64_i2c_init();
  ssd1306_clearScreen();

  canvas.drawRect(5, 0, 30, 63);  
  canvas.blt(0, 0); 
}
void loop() {}

This is an example of what I mean, the complete rectangle was does with a width of 64, the jagged one a width of 48.

Images

ESP32 component integration

Hi,
i am currently trying to integrate your SSD1306 library into an ESP-IDF C project.
I am using an I2C SSD1306 128x64px OLED Display on an ESP32 dev board.

I copied the "ssd1306" folder which includes the "src" folder into the projects "components" folder.
I can reference the library but as i compile it, the reference of the functions defined in ssd1306_generic.c cannot be found.

I included the following files
#include "ssd1306.h"
#include "ssd1306_fonts.h"

Inside that "ssd1306_fonts.h" header file the missing functions are defined.

The function "ssd1306_128x64_i2c_init()" can be found
the functions
ssd1306_setFixedFont()
ssd1306_fillScreen()
ssd1306_setCursor()
ssd1306_write()
cannot...

is there something i missed?
best regards

Instructions for running demo code on ATmega88PA

I see that you have Atmega328 and Atmega168 as supported devices. I'm pretty new to AVR development, and I was wondering if it would be feasible to run this code for the ATmega88PA without significant alteration. I apologize if this is a really dumb question, and I'm looking forward to your reply.

Redefining the pins for Atmega32u4 not working?

Please provide the following information:

library version

ssd1306-1.7.6

LCD display type

I2C SSD1306 128x64

Steps to reproduce the issue

I tried changing the pins in ssd1306_i2c_conf.h for my Atmega32u4 @ 16MHz. But it does not display anything when pins changed and code compiled again. Working fine on the Atmega328 @ 16MHz using pin A4 and A5 with I2C. I tried 18, 19, 7,8 and 0,1 because my I2C on my Pro Micro for the display is wired to A0 and A1.
So I am having problems with this lib on my Arduino Pro Micro. It did work fine on the Uno.

Expected behavior

It should display text when uploading the test example.

Actual behavior

Display stays black.

Rework ssd1306_drawBitmap() to allow any Y-position

Version: 1.4.7
SSD1306

I'm thinking on reworking ssd1306_drawBitmap() and NanoCanvas::drawBitmap() functions. The main idea for ssd1306_drawBitmap() is to allow output bitmap to OLED display at any pixel Y-position. At present it allows to draw only at Y=0, 8,16, 24, etc.
This will allow to do many things without using buffer.

Bigger font ssd1351, Arduino M0 Pro

Please provide the following information:

library version 9d74c90

LCD display type 1.5 inch 128x128 ssd1351

Steps to reproduce the issue N/A

Expected behavior N/A

Actual behavior N/A

The good news is that I have this up and running on an Arduino M0 Pro (which I'm sad that they've retired because it's great). The bad news is that I can't figure out how to get bigger font than the 6X8 using:
ssd1306_setFixedFont(ssd1306xled_font6x8);
ssd1306_printFixed8(0, 16, "Test String", STYLE_NORMAL);

I see routines like ssd1306_printFixedN in the code, but I can't seem to get them to work on this system. It's probably operator-error on my part. Can you show me the light on this?

Can't compile for Atmega328

Hi @lexus2k. I tried compile your examples for Atmega328, but I getting a lot of same errors with unknown type name 'class'.
Could you help me?

In file included from C:\Users\yadro\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Print.h:27:0,
                 from C:\Users\yadro\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Stream.h:26,
                 from C:\Users\yadro\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\libraries\Wire\src/Wire.h:26,
                 from E:\MyProjects\Arduino\libraries\ssd1306\src\i2c\ssd1306_i2c.c:151:
C:\Users\yadro\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino/Printable.h:25:1: error: unknown type name 'class'
 class Print;
 ^
...

Screen rotation feature

Hello!
I've just encountered yours library, and I really like the features, the one thing that one might find lacking is screen rotation. Actually, if whole screen (with coords) rotation would be cumbersome to do, maybe just canvas rotating would be easier to implement it would still help alot. And by rotation I meant just simply 90deg rotations, nothing too much fancy ofc.

Greetings.

Bigger Fonts

library version

1.3.1

LCD display type

SSD1306 I2C

I like your libary.
Can you integrate bigger Fonts? And possible to mix small + big fonts in one screen?

Communication with other I2C devices

Hello
my main question is: How can a controller communicates with other I2C devices while using this library?

library version

1.7.6

LCD display type

I2C SSD1306 128x64

Steps to reproduce the issue

I´m trying to communicate between an ATTiny 85 (master), a display (slave) and another device (slave, reader) via I2C. For the interaction with the another device (which is at the moment an Arduino for testing) I use the Wire library from Arduino. Therefore I have also changed the I2C pins in the ssd1306_i2c_conf file to the pins which are used by the Wire library.

Expected behavior

The display works and the ATTiny sends data to the Arduino.

Actual behavior

When I start the programm on the ATTiny, only the display works and the Arduino does not get any data.
(If I use the code without the display part, the Arduino will get the correct data).

many thanks

The project

I contacted you some time ago and you did change your libraries so also ATtiny84 could be used.
I have now my project ready.
ATtiny84
Program Storage 7202b 87% - Dynamic memory 202b 39%
#include "ssd1306.h"
#include "nano_gfx.h"
Display SSD1306 I2C
Digital ports 6
Analog ports 2

Thank you for your support.

sc-interface

The functionality
I am making my own audio test equipment and this is a soundcard interface for testing audio specifications.

flip screen

Perhaps I haven't found the function, but is there any way to flip the screen?

Regards

ATtiny84 support ?

Please provide the following information:

library version ssd1306

OLED display type ssd1306

Steps to reproduce the issue -

Expected behavior - load the sketch to ATtiny84

Actual behavior - errors - no loading

The sketch / drivers work with ATtiny85 - really great. But I need more I/O's and would like to use the ATtiny 84.
What changes do I need to do?

Small height filled rectangles mask issue

When drawing small height filled rectangles with NanoCanvas::fillRect() if y1 and y2 are in the same bank the mask calculated wrong by
"mask = (mask >> ((y1 & 7) + 7 - (y2 & 7))) << (7 - (y2 & 7));" in line #92 of file nano_gfx.cpp.
The filled rectangle vertical position will be pseudo random depending on y1 and y2.
This behavior applies to only small height (1-7 pixels) objects, and don't apply to >8 pixel height filled rectangles (as y1 and y2 are not in the same bank and mask calculated elsewhere).

Reproducing - see the attached project file (.txt extension)

Because of the last tag of mask based on y2 not y1, when drawing a slightly descending line (from left to right) using fillRect() it can be seen a strange line with random segments.

Fix:
"mask = (mask >> ((y1 & 7) + 7 - (y2 & 7))) << (y1 & 7); "

Library version: 1.4.2
LCD display type: SSD1306 based 128x32 monochrome OLED

GL_mini_OLED_disp_fix_nanoGFX_fillRect.txt

Umlaut support

First of all,I'm extremely impressed by the tiny size of the library! It's exactly what I was dreaming of.

I'm currently building a cat feeding machine for a german speaking family, so I'm looking for a way to display the so-called "Umlaute" (äöü). This is analog to the french accents (éàè).

Is there some Umlaut support in ssd1306?

Pixel draw

Something up (latest version as of this afternoon..

SSD1306 32 pixel display.

      ssd1306_clearScreen(); ssd1306_drawRect(0,0,127,31);
      for (int a=0;a<25;a++)
        {
        ssd1306_putPixel(a+1,29); 
        }

After the rectangle is drawn (ok) - this new line is wiping out the rectangle underneath it.

I think it is writing a vertical line with the correct pixel lit up - but actually writing an entire byte vertically...

compile error esp8266

I'm trying to compile the ssd1351_demo but I get this error:

#include "hal/io.h"
^
compilation terminated.

Edited usersettings.h, but no way.
I installed the library both from ide and manually, same result...

Fill

Not QUITE understanding the fill rect function in canvas

canvas.fillRect(80,20,100,25,1);

That last parameter - I've tried 1, 255, -1 - I cannot fill a rectangle in white on the SSD1306 32 high display... rectangle and text works just fine

???

custom_font_unicode display problem

Please provide the following information:

library version

 master

LCD display type

 ssd1306  128x32 i2c

Steps to reproduce the issue

  run demo custom_font_unicode

Expected behavior

 `    // First variant of usage: using unicodes with standard ascii font
ssd1306_setFixedFont( ssd1306xled_font6x8 );
ssd1306_setSecondaryFont( g_customUnicodeFont_6x8 );
ssd1306_printFixed (0,  8,  "Ascii + Ää", STYLE_NORMAL );

// Second variant of usage: without standard ascii font
ssd1306_setFixedFont( g_customUnicodeFont_6x8 );
ssd1306_printFixed (0,  16,  "ÄäÄäÄä", STYLE_NORMAL );`

Actual behavior

image

Bitmap from esp32 SPIFFS?

This is more of a question than an issue. I'm just not sure where else to ask a question.

Is there a way to store a png image in the ESP32 SPIFFS filesystem then read the file and somehow pass the contents to the ssd1306_drawBitmap8() or ssd1306_drawMonoBitmap8() functions?

I started by copying the code in the sova.cpp and pasting it into this site: http://javl.github.io/image2cpp/

That site converted it to a png file which I saved and uploaded into my esp32's SPIFF filesystem. The name of the file is: "/birds.png" Then I tried this and some variations. It almost works, I'm getting static on the screen, but I don't see the birds.

`const char * filename="/birds.png";
fs::File imgFile = SPIFFS.open( filename, "r");

uint8_t buf[1534];
int siz = imgFile.size();
while(siz > 0) {
  size_t len = min((int)(sizeof(buf) - 1), siz);
  imgFile.read((uint8_t *)buf, len);
  siz -= len; 
  imgFile.close();
} 
ssd1306_drawMonoBitmap8(0, 0, 128, 64, buf);`

Anyone have any ideas on what is wrong?

SH1106 fix

Please provide the following information:

library version

1.7.6

LCD display type

SH1106

Steps to reproduce the issue

Just print any text

Expected behavior

Text is fully visible

Actual behavior

First two pixel columns are missing

To fix this you should change the lines number 73 and 74 in oled_sh1106.c file like this:
ssd1306_intf.send(((x+2)>>4) | SSD1306_SETHIGHCOLUMN);
ssd1306_intf.send(((x+2) & 0x0f) | SSD1306_SETLOWCOLUMN);

Plain AVR/C/Atmel Studio for ATMega88PA

I was wondering how if possible to your this diver for plain AVR and the ATMega88PA. Basically, the thing that I am confused on is I don't understand avr-gcc. I don't understand how to build this and how to build it in Atmel Studio. Sorry, I'm kind of new to all of this. Thanks!

`%` character flipped

Not sure if it is intentional, but the default font for rendering the % character is fliped left/right (or top/bottom depending on how your brain works ^^)

However the courier_new_font11x16_digits displays the % character correctly

LCD display type

SSD1306

Steps to reproduce the issue

#include "ssd1306.h"
#include "font6x8.h"
void setup()
{
    ssd1306_128x64_i2c_init();
    ssd1306_fillScreen(0x00);
    ssd1306_setFixedFont(ssd1306xled_font6x8);
    ssd1306_printFixed  (0,  8, "This % isn't right", STYLE_NORMAL);
}
void loop(){}

Actual behavior

img_20180129_132920

move bitmaps

Is it possible to move bitmaps? How to implement this? Thank you.

which ssd1306 library on the Arduino IDE library manager to use?

I'd like to use the ssd1306 arduino library for my "ESP8266 0.96''OLED ESP-12F WIFI Development Board":
https://www.ebay.es/itm/ESP8266-0-96OLED-ESP-12F-WIFI-Development-Board-CP2102-Micro-USB-18650-Battery/113002221260

Your README.md file says:

Setting up
Setting up for Arduino: (variant 2)
Install ssd1306 library via Arduino IDE library manager

there are many ssd1306 libraries on the Arduino IDE library manager.
for instance: Acrobotic SSD1306, Adafruit SSD1306, ESP8266 and ESP32 Oled Driver for SSD1306 display...

Which one of those libraries are compatible?

Error Error compiling for oled 1306 in arduino and AtTiny85

I am trying to compile the ssd1306_demo from the Arduino 1.8.5 IDE version, with the library version 1.7.2 but I get this error with AtTiny85:

libraries \ ssd1306 \ ssd1306_8bit.c.o (symbol from plugin): In function `ssd1331_setColor ':

(.text + 0x0): multiple definition of `ssd1331_drawBufferFast16 '

libraries \ ssd1306 \ ssd1306_16bit.c.o (symbol from plugin) :(. text + 0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
Compiling error for the ATtiny25 / 45/85 card.

Or with an Arduino UNO:

Archiving built core (caching) in: C: \ Users \ wataru \ AppData \ Local \ Temp \ arduino_cache_660515 \ core \ core_arduino_avr_one_f76447c3c6205e5ecc0585c82388c111.a
libraries \ ssd1306 \ ssd1306_8bit.c.o (symbol from plugin): In function `ssd1331_setColor ':

(.text + 0x0): multiple definition of `ssd1331_drawBufferFast16 '

libraries \ ssd1306 \ ssd1306_16bit.c.o (symbol from plugin) :(. text + 0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for the Arduino / Genuino Uno card.

I installed the library both from ide and manually, same result ...,
and I do not know how to continue, or if you want to change something in the configuration files.

NanoCanvas::fillRect x-y inconsistency

NanoCanvas::fillRect() x/y size is inconsistent, and also inconsistent with ::drawRect().

Calling c.fillRect(10,10, 13, 13, 0xFF); results in drawing a 3x4 pixel filled rectangle instead of a 4x4 pixel filled square, caused by line #102 in file nano_gfx.cpp (x>x2):
for (uint8_t x=x1; x<x2; x++)
Fix:
for (uint8_t x=x1; x<=x2; x++)

Library version: 1.4.2
LCD display type: SSD1306 based 128x32 monochrome OLED

EOL

Not an issue.. but I've pulled your code as I need an EOL facility... if you add that to yours - I'll scrap mine rather than keep 2.

In my minor change - I've added an optional parameter - see ERASE_EOL

ssd1306_charF6x8(0, 2, "Test",STYLE_NORMAL,ERASE_EOL);

Rotating a font by 90 before displaying it

What is the best method to rotate a font by 90degress before displaying it.
I need to print text along he height of the screen instead of the width but I am having trouble adding a rotating algorithm.
The best solution I can think of so far is to rotate 1 pixel at a time but that very slow and it also doesn't work very well.
I have tired using "GLCD Font Creator" by rotation is not possible.

Thanks

New fonts

Hi,

Using this library for watch project. Please add more fonts. As I understood I can only add custom fonts not bigger than 6x8, but for watch i defenetly need a bigger one.

"draw_bitmap" problem with bottom 8 pixels

library version

1.2.5

LCD display type

SSD1306

Steps to reproduce the issue

flash "draw_bitmap" (tried on Arduino Uno and Attiny45)

Expected behavior

Draw the owl

Actual behavior

Draws the owl but the top 8 pixels are cut on the top and the bottom 8 pixels are not refreshed.

I uploaded "draw_text" (with "ssd1306_charF6x8(0, 7, "Line 7. Italic text", STYLE_ITALIC);") before and then uploaded "draw_bitmap" to show, that the 8 pixels on the bottom don´t refresh.

image

Araknoid compile fails for Arduino Nano after upgrade from library 1.4.12 to 1.5.0

Please provide the following information:

library version

1.5.0

LCD display type

default

Steps to reproduce the issue

update library to 1.5.0 using arduino 1.8.3 IDE, then compile araknoid example for arduino nano

Expected behavior

compiles with library 1.4.12

Actual behavior

fails with library 1.5.0 with the following:

Arduino: 1.8.3 (Mac OS X), Board: "Arduino Nano, ATmega328P"

Documents/Arduino/libraries/ssd1306/examples/arkanoid/arkanoid.ino: In function 'void drawPlatform()':
arkanoid:211: error: 'ssd1306_setRamBlock' was not declared in this scope
ssd1306_setRamBlock( pos + LEFT_EDGE + 1, PLATFORM_ROW, platformWidth + PLATFORM_SPEED * 2 );
...

esp32 non-standard i2c pins

is there a way to init esp32 for non standard i2c pins?
I have a dev board with ssd1306 i2c hardwired to pins 4,5 (scl, sda).
I didn't see a way to override this during init, e.g. w/ ssd1306_128x64_i2c_init()
I could fix it by hacking directly on ssd1306_i2c_common.c, but wonder if there is a better way?

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.