Coder Social home page Coder Social logo

esp32-i2c-ssd1306-oled's Introduction

#ESP32 I2C OLED SSD1306 library for esp-idf

This is a library of i2c oled ssd1306 for esp-idf.

Code modified from ESP-I2C-OLED.

I changed the code style into C++. So you can easily use multiple devices by create different objects. I also changed the hardware i2c driver into a software one. So you can use any two GPIO pins as SDA and SCL.

IMPORTANT: If you want to compile it, be sure that you add "COMPONENT_LDFLAGS += -lstdc++" in Makefile.

Pay attention that OLED class has two different constructors. One with default I2C address 0x78, but in the other you can set manual address.

Remember to call refresh after you draw something new on the screen.

External RESET pin function is not implemented yet.

NOTICE1: If you want to use pure C method, please turn to branch pure-c

NOTICE2: I'm using C++ style string, if you don't want that, you can uncomment related code blocks in ssd1306.cpp and ssd1306.hpp.

esp32-i2c-ssd1306-oled's People

Contributors

imxieyi 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

esp32-i2c-ssd1306-oled's Issues

OLED with i2c font more then 2 is not display

I am trying to use OLED with i2c it is display but when I am trying to display equal or more then 2 font it is not display.

and please tell us how to us scroll and other things with this library.

i2c write fail incorrect

This part of code makes some identical oleds not to work

	if (!i2c->write(address)) {
		i2c->stop();
		ESP_LOGE("oled", "OLED I2C bus not responding.");
		goto oled_init_fail;
	}

It is caused by I2C::write()

// return: true - ACK; false - NACK
bool I2C::write(uint8_t data)
{
    uint8_t ibit;
    bool ret;

    for (ibit = 0; ibit < 8; ++ibit)
    {
        if (data & 0x80)
            _SDA1;
        else
            _SDA0;
        _DELAY;
        _SCL1;
        _DELAY;
        data = data << 1;
        _SCL0;
    }
    _SDA1;
    _DELAY;
    _SCL1;
    _DELAY;
    ret = (_SDAX == 0);  // it is always 0 on some oleds
    _SCL0;
    _DELAY;

    return ret;
}

If we ignore __SDAX==0 and return true all works fine. Might related be some incorrect protocol response

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.