B4R Tutorial How to connect a 7 pin OLED display, (NOT 4 pin)...

Discussion in 'B4R Tutorials' started by Peter Simpson, Mar 5, 2017.

  1. Peter Simpson

    Peter Simpson Expert Licensed User

    Here is how to connect a 7 pin OLED display to an Arduino.

    If you are anything like me, you previously owned a Raspberry Pi and did absolutely nothing with it. Well before I ever owned any Arduino hardware I had purchased this blue 128 x 64 OLED display. Today I decided to connect it to my Uno.

    On the forum you will find that Erel demonstrates a 4 pin OLED display working perfect bouncing a ball around the display, that program will NOT work with this display without using ALL of the pins. If you use the below wiring legend and the below Initialization string with Erel's ball program, you will happily see a ball quickly bouncing around your 7 pin OLED display.

    BTW before somebody contacts me to say that they removed the GND and VCC jumpers leads and the display still works, it's not recommended that you do that. The GND and VCC are their for a reason, so you should really use them.

    You need the following libraries: rAdafruitGFX and rAdafruitSSD1306 under your libraries tab.

    What it looks like when wired up.

    Labels: SCK also known as D0 & SDA also known as D1 on some OLED displays.

    'WIRE LEGEND for 12864 7 pin OLED display
    'VCC (VDD)= 3.3V
    'GND = GND
    'D0 (SCK) = D13
    'D1 (SDA) = D11
    'RST (RES) = D8
    'DC = D9
    'CS (SS) = D10

    Sub Process_Globals
    'These global variables will be declared once when the application starts.
        'Public variables can be accessed from all modules.
        Public Serial1 As Serial
    Public SSD As AdafruitSSD1306
    End Sub

    Private Sub AppStart

    'I could have declared the pins in Globals and initialised them here, but I opted not to do that.

    9810'in Erels ball demo, use this InitializeHSPI instead to see the ball bounce
    1, SSD.WHITE, False)

    "B4X +=1")

    "That does not work")


    End Sub
    Last edited: Mar 7, 2017
    spairo, f0raster0, gvoulg and 3 others like this.
  2. spairo

    spairo Member Licensed User

    - 7 pin OLED working also with AT Tiny85 and DS18B20 1-wire sensor.

    Attached Files:

    Peter Simpson and Erel like this.