Introduction: Custom Menu Options Using Adafruit SSD1306 SPI Display and Arduino

About: Electrical engineering and computer science specialist

I had this display sitting in my IOT box for a while now and today I decided to play around with it.

I came up with an idea to create a custom menu which can be used in all sort of electronic devices.

Step 1: Parts

1 x Breadboard or PCB

Couple of jumper wires

4 x SPST switches

4 x 10 kOhm resistors

1 x Arduino board (I've used UNO, but each one will do the job)

1 x Adafruit SSD1306 SPI display (Mine is not an original one. I've bought it from Aliexpress and I assume most SPI displays will work with their library)

Step 2: Software

You will need the latest Arduino IDE found here -> https://www.arduino.cc/en/software

Adafruit 1306 library -> https://github.com/adafruit/Adafruit_SSD1306

Step 3: Connections

Display

  • Display pin MOSI to Arduino pin 9
  • Display pin CLK to Arduino pin 10
  • Display pin DC to Arduino pin 11
  • Display pin CS to Arduino pin 12
  • Display pin RST to Arduino pin 13

Buttons

  • UP button to Arduino pin 3
  • DOWN button to Arduino pin 2
  • ENTER button to Arduino pin 4
  • BACK button to Arduino pin 5

Pull-down resistors

You must tie each Arduino pin to GND with 10kOhm resistor in order for pin to be digital LOW while button is not pressed.

Step 4: Code

Here is the full source code.

Please reach out if you need any assistance or detailed explanation.

Step 5: Preview