-->
Page 1 of 13

Added Basic OLED Library for 0.96" I2C OLED - NodeMcu

PostPosted: Thu Feb 26, 2015 1:08 am
by pracas
Hi,
I've just added a basic OLED Library for the 0.96" I2C OLED Displays that come with the Address 0x3C (hardcoded!)
Its build with modified code from the adafruit arduino library and this i2c_oled library

/* Usage Notes
Works only with i2c 0.96" OLED Displays with Device Address 0x3C - Hardcoded Device ID
Does Default Setup Automatically
oled.setup(sda,scl) => Sets up the Screen uses default 0x3C i2c device address for 0.96" Cheap OLED Modules
oled.clear() => To Clear Screen
oled.line(line number, font size, "text to be printed" ) // Font Size can be 1 or 2
oled.print(x,y, font size, "text to be printed" ) // Font Size can be 1 or 2
oled.invert(val) // val can be 1 or 0
*/

Let me know how it goes

Cheers,
Pracas

Re: Added Basic OLED Library for 0.96" I2C OLED - NodeMcu

PostPosted: Thu Feb 26, 2015 1:15 am
by pracas

Re: Added Basic OLED Library for 0.96" I2C OLED - NodeMcu

PostPosted: Thu Feb 26, 2015 3:56 am
by alonewolfx2
Can you share your code? Maybe we can handle ic2 address things.
Edit: some basic information and usage.

your heap is 18320 for st-ap mode, 20452 for station mode, 19936 for ap mode.

you have 7 line and 20char per line for "font size=1"
you have 4 line and 16char per line for "font size=2" but you must to use line=0,2,4,6.
for ex: oled.print(0,0,2, "0123456789012345" ) code is working correctly but oled.print(0,0,2, "012345678901234500" ) not displaying correctly.

Re: Added Basic OLED Library for 0.96" I2C OLED - NodeMcu

PostPosted: Thu Feb 26, 2015 7:57 am
by pracas
Hi,

Sure i will share it. I would be more than glad. I've just played around till i got what i wanted.
This is my first ever attempt at anything similar. Just figuring out github. Give me a day and it should be on github

cheers,
pracas