For all of the different kinds of small OLED monochrome displays, you'll need to install the Arduino libraries. The code we have is for any kind of Arduino, if you're using a different microcontroller, the code is pretty simple to adapt, the interface we use is basic bit-twiddling SPI or I2C
Using these OLEDs with Arduino sketches requires that two libraries be installed: Adafruit_SSD1306, which handles the low-level communication with the hardware, and Adafruit_GFX, which builds atop this to add graphics functions like lines, circles and text.
In recent versions of the Arduino IDE software (1.6.2 and later), this is most easily done through the Arduino Library Manager, which you’ll find in the “Sketch” menu: Sketch→Include Library→Manage Libraries…
Enter “ssd1306” in the search field, locate the Adafruit SSD1306 library and select “Install” (or “Upgrade” if you have an older version). Then repeat the same for “gfx” and the Adafruit GFX library.
If you’re using an earlier version of the Arduino IDE software and need to install libraries manually, or if you’d like to download the library source code to look inside, both of these can be found on Github.
Or here are links directly to the ZIP files:
After uncompressing, the folders should be renamed (if necessary) to Adafruit_SSD1306 and Adafruit_GFX. The former should contain the files Adafruit_SSD1306.cpp and Adafruit_SSD1306.h (plus a few extra files). Sometimes unZIPping creates a nested Adafruit_SSD1306 folder within another folder…you don’t want that. The latter should contain Adafruit_GFX.cpp and Adafruit_GFX.h (plus some extra files).
Place both folders in your (home)/Documents/Arduino/Libraries folder. You may need to create the libraries subfolder if its your first library. Restart the Arduino IDE.
We also have a great tutorial on Arduino library installation here:
After installing the Adafruit_SSD1306 and Adafruit_GFX library, restart the Arduino IDE. You should now be able to access the sample code by navigating through menus in this order: File→Sketchbook→Libraries→Adafruit_SSD1306→SSD1306...
After you've finished wiring the display as indicated on the following pages, load the example sketch to demonstrate the capabilities of the library and display.
The OLED SSD1306 driver is based on the Adafruit GFX library which provides all the underlying graphics functions such as drawing pixels, lines, circles, etc. For more details about what you can do with the OLED check out the GFX library tutorial