One of the device is http://www.geekonfire.com/wiki/index.php?title=I2C_OLED_Panel(128x64)#Resources. It works on UNO and MEGA at 100kbps, but at 400kbps only works at MEGA.(I have tested it on MEGA2560,MEGA1280 and MEGA Olympic)
code in library:
//uint8_t twbrbackup = TWBR;
//TWBR = 12; // upgrade to 400KHz!
// TWBR = twbrbackup;
if I enable the above sentences, It doesn't work at UNO.
void GOFi2cOLED::display(void) {
sendCommand(0x00 | 0x0); // low col = 0
sendCommand(0x10 | 0x0); // hi col = 0
sendCommand(0x40 | 0x0); // line #0
// save I2C bitrate
//uint8_t twbrbackup = TWBR;
//TWBR = 12; // upgrade to 400KHz!
// I2C
#if defined(ARDUINO) && ARDUINO >= 100
for (uint16_t i=0; i<(128*64/8); i++)
{
// send a bunch of data in one xmission
Wire.beginTransmission(SlaveAddress);
Wire.write(GOFi2cOLED_Data_Mode); // data mode
for (uint8_t x=0; x<16; x++)
{
Wire.write(buffer[i]);
i++;
}
i--;
Wire.endTransmission();
}
#else
for (uint16_t i=0; i<(128*64/8); i++)
{
// send a bunch of data in one xmission
Wire.beginTransmission(SlaveAddress);
Wire.send(GOFi2cOLED_Data_Mode); // data mode
for (uint8_t x=0; x<16; x++)
{
Wire.send(buffer[i]);
i++;
}
i--;
Wire.endTransmission();
}
#endif
// TWBR = twbrbackup;
}