GithubHelp home page GithubHelp logo

nicoud / oled Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 5.0 246 KB

OLED SSD1306 compact lib with and without buffer, I2C TWI or bit-banging. Written in C, modular include files, compatible with Arduino, but also stand-alone.

C 89.55% C++ 10.45%
oled ssd1306 compact arduino i2c bit-banging bit-bang

oled's Introduction

File reorganization, TerSer compatibility OledPix --> PixOled, etc

OledPix - "no buffer" lib for SSD1306. OledMap - need 1k buffer

Oled screen

The xxOled.h are include files written in C. That is simple modular file to refer to, one setup function to call, take the files you need an modify if required.

See OledLib for the structure, OledLib Functions for the list of commands, and OledI2C for the two I2C libraries of minimum size.

Application examples tested on Arduino are mostly documented in French.

The picture shows also a PIC 10F202 (512 12-bit instructions) programmed in assembler as a proof of compactness (no character generator and few functions).

OledPix.h lib is quite useful to help debugging, showing variables and sensors values as numbers and simple graphic, adding only 2-3k of program and few ms to update a value on screen or write the next dot (no buffer to transfer).

The new xxOled.h family of files follows the logic of the construction of your application. The SSD1306 must be connected on 2 pins. If you use the I2C pins on AVR328, load TwiOled.h. If other pins adapt the BitBang file Bb7654Oled.h - 10 lines to understand and change. Next you need the Oled setup, the charater generator and the possibility to write texts: load the PixOled.h or the MapOled function; it allows to put text and dots.

If you need to show numbers, add the NumOled.h file or the TerOed.h more complete and compatible with the SerOled that replace the Arduino Serial.print terminal. This will cost you only 2 to 3 kbytes of memory and 80 bytes of variable.

Depending on you application, you add the LineCircle.h file, the Pong.h and a file.h with all your functions. Main program stay clean. If you do not like to see many include filer, you can pack them together in a single one, but you loose the vision of the structure of your program..

If you already used OledPix.h, it is easy to update with new file names. Several Gencar charaters have been improved. No function has been lost.

OledMap is faster when you call a function and draw inside memory, but the required Show(); instruction to see the result takes 70 ms. OledMap has the advantage over GFX that one can modify a function, add a new one in minutes, remove unused functions to save program memory. With little programming skill, one can do a mix of OledPix and OledMap to have a small bitmap with frequent updates and use direct write to the rest of the screen.

SSD 1306 with 128x32 format

Add two lines at the end of setup SetupOledMap() or SetupOledPix() in order to be compatible with 32 lines. Cmd (0xDA); Cmd (0x02); But now the text lines are numbered 4,5,6,7. No guarantie is given for what happen on lines 0,1,2,3 and for dots with y>32. Two functions are available now: DoubleH(); - for 128x32, SingleH(); back to 128x64.

oled's People

Contributors

nicoud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.