OLED 96x16 doesn't work

Hi,

finally i unsealed box and tried to run this OLED but it does not work, i used “working” sketch from the OLED wiki page.

hardware is USB connected Arduino Nano (328P)

Mb OLED is broken ? I didn’t drop it.

Thanks!

P.S. OLED is absolutely dark when powered on, do i need to use pull-up resistors ?

Is it a Electronic brick - OLED 96x16 Display?
Please try for the below test sketch.

#include <Wire.h>
#define OLED_address 0x3c
unsigned char fill_OLED=0x55;
unsigned char fill_string1[]=“SeeedStudio”;
unsigned char fill_string2[]=" OLED 96*16";
unsigned char fill_string3[]="@@@@@@@@@@@@";
extern unsigned char myFont[][8]; //PROGMEM
//==================================
void print_a_char(unsigned char ascii=0)
{
unsigned char i=0;
for(i=0;i<8;i++)
{
SendChar(myFont[ascii-0x20][i]);
}
}
//==================================
void setup()
{
Wire.begin();
init_OLED();
delay(10);
clear_display();
delay(500);

}
//========================
void loop()
{
int i=0;

display_test();
delay(100);
clear_display();
delay(50);

for(i=0;i<2;i++)
{
setXY(i,0);
sendStr(fill_string3);
}

while(1)
{
sendcommand(0xa6);
delay(1000);
sendcommand(0xa7);
delay(1000);
}
}

//=======================
void sendcommand(unsigned char state)
{
Wire.beginTransmission(OLED_address); //
Wire.send(0x80);//command mode
Wire.send(state);
Wire.endTransmission(); // stop transmitting
}
//==================================
void display_test(void)
{
unsigned char i,k;
// unsigned char Byte=0;
//for(k=0;k<2;k++)
{
setXY(0,0);
for(i=0;i<96;i++)
{
// Byte=myFont[i>>3][i&0x07];
//SendChar(Byte);
SendChar(0xff);
delay(20);
}
setXY(1,0);
for(i=0;i<96;i++)
{
// Byte=myFont[i>>3][i&0x07];
//SendChar(Byte);
SendChar(0xff);
delay(20);
}
}
}
//==================================
void clear_display(void)
{
unsigned char i,k;
for(k=0;k<2;k++)
{
setXY(k,0);
for(i=0;i<128;i++)//clear all COL
{
SendChar(0);
delay(10);
}
}
}
//===================================
void SendChar(unsigned char data)
{
Wire.beginTransmission(OLED_address); //
Wire.send(0x40);//data mode
Wire.send(data);
Wire.endTransmission(); // stop transmitting
}
//===================================
void setXY(unsigned char line,unsigned char row)
{
unsigned char realrow=row;
sendcommand(0xb1+line);
sendcommand(0x00 +(8realrow&0x0f));
sendcommand(0x10 +((8
realrow>>4)&0x07));

/*
sendcommand(0xb1+line);
sendcommand(0x00+((8realrow-1)&0x0f));
sendcommand(0x10+(( (8
realrow-1)>>4)&0x07));
*/

}
//==================================
void sendStr(unsigned char *string)
{
unsigned char i=0;
//setXY(0,0);
while(*string)
{
for(i=0;i<8;i++)
{
SendChar(myFont[*string-0x20][i]);
delay(10);
}
*string++;
}
}
//=================================
void init_OLED(void)
{

sendcommand(0xae); //display off
sendcommand(0xa1); //seg re-map 127->0
sendcommand(0xaf); //display on
// sendcommand(0xa6);
delay(10);
}