In this tutorial basically we're going to learn how to take input from keypad and show it on our desired OLED display. For this i would suggest you see my other tutorials as prerequisite Kepad Tutorial and OLED Display Tutorial
If you miss these tutorial you might not be able to do this.
Including Library:
Both libraries below needs to be installed before you are able to continue with this instructable.
https://github.com/adafruit/Adafruit_SSD1306 (SSD1306 library)
https://github.com/adafruit/Adafruit_SSD1306 (GFX library)
The connections from the display:
VCC to arduino 5v GND to arduino GND SCL to arduino pin A5 SDA to arduino pin A4
Library Correction :
For Adafruit_SSD1306 Library:
Go to: C:\Program Files (x86)\Arduino\libraries\Adafruit_SSD1306 Open Adafruit_SSD1306.h (in a text editor like Notepad++ for example) Find and comment out the line: #define SSD1306_128_32 Uncomment the line: #define SSD1306_128_64 Open the ssd1306_128x64_i2c example in Arduino: Change address from 0x3D to 0x3C in void setup()
you can find a more clear tutorial and also the code below the link: