Sign up ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

I have Arduino UNO with 0.96" OLED display with 128(width)*32(height). It is said that I have to edit Adafruit_SSD1306.h for my 128*32 OLED, okey I did it from 128*64 to 128*32 but I still get the compiler error:

ssd1306_128x32_i2c.ino:54:2: error: #error ("Height incorrect, please fix Adafruit_SSD1306.h!");

Yes, I fixed the Adafruit_SSD1306.h file, but now, it is still gives me a compiler error:

C:\Users\OB\Documents\Arduino\libraries\Wire\utility/twi.h: In member function 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)': C:\Users\OB\Documents\Arduino\libraries\Wire\utility/twi.h:47: error: too many arguments to function 'uint8_t twi_readFrom(uint8_t, uint8_t*, uint8_t)' C:\Users\OB\Documents\Arduino\libraries\Wire\Wire.cpp:85: error: at this point in file C:\Users\OB\Documents\Arduino\libraries\Wire\utility/twi.h: In member function 'uint8_t TwoWire::endTransmission(uint8_t)': C:\Users\OB\Documents\Arduino\libraries\Wire\utility/twi.h:48: error: too many arguments to function 'uint8_t twi_writeTo(uint8_t, uint8_t*, uint8_t, uint8_t)' C:\Users\OB\Documents\Arduino\libraries\Wire\Wire.cpp:140: error: at this point in file C:\Users\OB\Documents\Arduino\libraries\Wire\Wire.cpp: In member function 'virtual size_t TwoWire::write(const uint8_t*, size_t)': C:\Users\OB\Documents\Arduino\libraries\Wire\Wire.cpp:195: error: invalid conversion from 'const uint8_t*' to 'uint8_t*' C:\Users\OB\Documents\Arduino\libraries\Wire\Wire.cpp:195: error:
initializing argument 1 of 'uint8_t twi_transmit(uint8_t*, uint8_t)'

enter image description here enter image description here

How can I use my four-pin OLED display with no errors?

share|improve this question
    
It looks like the code you are trying to use may require a different version of the twi library. –  Chris Stratton Nov 11 '14 at 17:21
    
Did you ever get this fixed? –  Dennis Munsie May 1 at 1:02
    
Yes, I have already made it so perfect. Thanks. –  Bay May 2 at 11:39
    
I hope I'm not late. Try to use arduino 1.0.6. –  컨트롤고기 Aug 16 at 11:34

2 Answers 2

May I suggest the following. I found this fork of the Adafruit library which works better than the one they have on their website Adafruit_ssd1306syp. The original Adafruit_ssd1306 library doesn't play nice with SPI and when you want to have your OLED running on i2c and use the SPI for something else. This is a great resource. Download, unzip to your libraries directory. Then run this sketch:

#include <Adafruit_ssd1306syp.h>

#define SDA_PIN A4
#define SCL_PIN A5

Adafruit_ssd1306syp display(SDA_PIN, SCL_PIN);

void setup() {

  display.initialize();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  printM("Starting Demo...");

}

void printM(String mess) {

  display.println(mess);
  display.update();
}

void loop() {

  printM("working");
  delay(1000);

}
share|improve this answer

Do you have the proper pullup's enabled on the I2C interface? Also some of the I2C displays have a different control chip so it's not identical to the Adafruit one. Verify which display controller is used on your board if you can.

If that is good looks like your sketch i still struggling with the I2C setup. Says too many arguments are being used.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.