Pages: [1]   Go Down
Author Topic: Kozig IIC I2C 0.96" 128X64 TWO Color OLED Display  (Read 2169 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've got this OLED from eBay: http://www.ebay.com/itm/New-Version-Arduino-IIC-I2C-0-96-128X64-TWO-Color-OLED-Display-Module-AVR-PIC-/160889283903?ssPageName=ADME:L:OU:US:3160

It have 8 pins:

PEN
VCC
3V3
GND
MIT
RST
SDA
SCL

It should work with this code:

Code:
// Wire Master Writer
// by Nicholas Zambetti <http://www.zambetti.com>

// Demonstrates use of the Wire library
// Writes data to an I2C/TWI slave device
// Refer to the "Wire Slave Receiver" example for use with this

// Created 29 March 2006

// This example code is in the public domain.

#include <Wire.h>

#define OLED_ADDRESS    0x51

#define WRITE_CMD       0x01
#define WRITE_DAT       0x02
#define RESET           0x03

#define DISP_8X16STR    0x10
#define DISP_AREA       0x11
#define FILL_AREA       0x12
#define SET_SCROHOR     0x13
#define SET_SCROVER     0x14
#define SET_SCROVERHOR  0x15

#define SET_ADDRESS     0x21

#define PAGE0           0x00
#define PAGE1           0x01
#define PAGE2           0x02
#define PAGE3           0x03
#define PAGE4           0x04
#define PAGE5           0x05
#define PAGE6           0x06
#define PAGE7           0x07

#define SCROLL_UP       0x01
#define SCROLL_DOWN     0x00
#define SCROLL_RIGHT    0x26
#define SCROLL_LEFT     0x27
#define SCROLL_VR       0x29
#define SCROLL_VL       0x2A

#define FRAMS_2         0x07
#define FRAMS_3         0x04
#define FRAMS_4         0x05
#define FRAMS_5         0x00
#define FRAMS_25        0x06
#define FRAMS_64        0x01
#define FRAMS_128       0x02
#define FRAMS_256       0x03

void Display8x16Str(uint8_t page, uint8_t column, const char *str)
{
    Wire.beginTransmission(OLED_ADDRESS);
    Wire.write(DISP_8X16STR);
    Wire.write(page);
    Wire.write(column);
   
    while(*str != '\0')
    {
         Wire.write(*str++);
    }
    Wire.endTransmission();
}
void FillArea(uint8_t spage, uint8_t epage,uint8_t scolumn, uint8_t ecolumn,uint8_t filldata)
{
    Wire.beginTransmission(OLED_ADDRESS);
    Wire.write(FILL_AREA);
    Wire.write(spage);
    Wire.write(epage);
    Wire.write(scolumn);
    Wire.write(ecolumn);
    Wire.write(filldata);
    Wire.endTransmission();
}
void ScrollingHorizontal(uint8_t lr, uint8_t spage, uint8_t epage,uint8_t frames)
{
    Wire.beginTransmission(OLED_ADDRESS);
    Wire.write(SET_SCROHOR);
    Wire.write(lr);
    Wire.write(spage);
    Wire.write(epage);
    Wire.write(frames);
    Wire.endTransmission();
}
void ScrollingVertical(uint8_t scrollupdown, uint8_t rowsfixed, uint8_t rowsscroll, uint8_t scrollstep, uint8_t stepdelay)
{
    Wire.beginTransmission(OLED_ADDRESS);
    Wire.write(SET_SCROVER);
    Wire.write(scrollupdown);
    Wire.write(rowsfixed);
    Wire.write(rowsscroll);
    Wire.write(scrollstep);
    Wire.write(stepdelay);
    Wire.endTransmission();
}
void ScrollingVertivalHorizontal(uint8_t fixedarea, uint8_t scrollarea, uint8_t vlr, uint8_t spage, uint8_t epage, uint8_t frames, uint8_t offset)
{
    Wire.beginTransmission(OLED_ADDRESS);
    Wire.write(SET_SCROVERHOR);
    Wire.write(fixedarea);
    Wire.write(scrollarea);
    Wire.write(vlr);
    Wire.write(spage);
    Wire.write(epage);
    Wire.write(frames);
    Wire.write(offset);
    Wire.endTransmission();
}
void DeactivateScroll()
{
    Wire.beginTransmission(OLED_ADDRESS);
    Wire.write(WRITE_CMD);
    Wire.write(0x2E);
    Wire.endTransmission();
}
void WriteCommand(const char *cmd)
{
    Wire.beginTransmission(OLED_ADDRESS);
    Wire.write(WRITE_CMD);   
    while(*cmd != '\0')
    {
         Wire.write(*cmd++);
    }
    Wire.endTransmission();
}
void WriteData()
{
    unsigned int i;
    Wire.beginTransmission(OLED_ADDRESS);
    Wire.write(WRITE_DAT);   
    for (i=0; i<20; i++)
    {
        // Wire.send(0xF0); 
    }
    for (i=0; i<20; i++)
    {
        // Wire.send(0x0F); 
    }
    for (i=0; i<32; i++)
    {
         Wire.write(0xFF); 
    }
    Wire.endTransmission();
}
void SetAddress(uint8_t page, uint8_t column)
{
    Wire.beginTransmission(OLED_ADDRESS);
    Wire.write(SET_ADDRESS);   
    Wire.write(page);
    Wire.write(column);
    Wire.endTransmission();
}
void Reset()
{
    Wire.beginTransmission(OLED_ADDRESS);
    Wire.write(RESET);   
    Wire.endTransmission();
}
void setup()
{
  Wire.begin();
  Serial.begin(9600);
  pinMode(13, OUTPUT);
  pinMode(12, INPUT);
  Reset();
}
void loop()
{
  int i;
  delay(1000);
  digitalWrite(13,HIGH);
  for(i=0; i<8; i++)
  {
      SetAddress(i,0);
      WriteData();
      WriteData();
      WriteData();
      WriteData();
  }
  delay(1000);
 
  digitalWrite(13,LOW);
  FillArea(0,7,0,128,0);
  delay(1000);
 
  digitalWrite(13,HIGH);
  Display8x16Str(0,0, "Hello World!");
  Display8x16Str(2,0, "Hello OLED!");
  Display8x16Str(4,0, "Wellcom to use");
  Display8x16Str(6,0, "Gem.Arduino");
  digitalWrite(13,LOW);
  ScrollingVertical(SCROLL_UP,0,32,1,250);
   delay(3000);
  ScrollingHorizontal(0x27, 4, 5, 0x07);
  delay(2000);
   DeactivateScroll();
  ScrollingHorizontal(0x26, 6, 7, 0x07);
  delay(2000);
  DeactivateScroll();
  FillArea(0,7,0,127,0);
  delay(1000);
  Reset();
  delay(2000);
 //*/
}


Have anybody worked with this device? It seem to not work with this.
Connecting VCC to 5V and GND to GND, nothing shows up or blink...

I would really appreciate any thoughts...
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have seen this for sale as well.
If you are getting no display It's probably because PEN = Power Enable needs to be high.
RST= Reset and I have no idea what MIT=?
I am looking at something similar but not quite the same. Kozig's website is in Chineese and I don't read chineese!
Hope this is ome help even though I am about 3 months too late : )

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

PEN - Power Enable
VCC - Power Supply
3V3  - Power 3.3V (I/O)
GND - Power Ground
MIT  - 1.indecated Busy(Active Low)during normal wrking,  the Module address is 0x50(do not include the Read/Write Bit) if MIT Active LOW during power Up or RESET,the Module address is 0x51(do not include the Read/Write Bit) if MIT Active LOW during power Up or RESET
RST  - Reset (Active Low)
SDA  - IIC SDA Wire
SCL  - IIC SCL Wire

The latest module Version is ZT.SC-I2CMx,  the module address can be program as you want
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also bought one of these also can't get it to work... With the code you supplied what must the wires be connected on the board? Must pen be connected to 5V or 3.3V also is MIT important or can I leave it out?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

bump
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Bump please help
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You guys suck!!!
OK well I got it working. The code as is will work with the OLED you describe. Just make sure you hook it up correctly.
If you go through the code you will notice he only uses pins A4 and A5 so no need to connect a reset pin or MIT pin.
Reset can be done by sending the reset command to the OLED. I think it was silly for them to include all those other pins because the advantage of using I2c is that fewer pins are needed and there they go putting 8 on the Screen.
Turns out PEN does nothing? I had it connected but then disconnected it didn't do a difference for me.
Anyway in summary all you need to do is 5V to Vcc; SDA SCL to A4 and A5 respectivly; and Ground to GND. Should work.
Logged

Sydney
Offline Offline
Full Member
***
Karma: 1
Posts: 108
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This OLED module is supported by my MultiLCD library. If you just want to display texts with it, my library will be very handy to use.
https://github.com/stanleyhuangyc/MultiLCD
Logged


Pages: [1]   Go Up
Jump to: