Story
This is spi oled 3.3v-5.0v. Note: The Github link of this project is: https://github.com/mike-rankin/spi_oled_3.3v-5.0v. This project is reposted with the approval of this project creator. He is a good DIY maker who designs custom ESP32 IoT projects using Altium Designer, Arduino IDE and Fusion360!!!! Welcome everyone to follow him. This is his GitHub account, Mike Rankin, where you will explore more excellent projects.
/*********************************************************************
This is an example for our Monochrome OLEDs based on SSD1306 drivers
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/category/63_98
This example is for a 128x64 size display using SPI to communicate
4 or 5 pins are required to interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information
All text above, and the splash screen must be included in any redistribution
*********************************************************************/
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
//Adafruit Default If using software SPI (the default case):
//#define OLED_MOSI 9
//#define OLED_CLK 10
//#define OLED_DC 11
//#define OLED_CS 12
//#define OLED_RESET 13
//Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
//My Arduino Nano Test Board
//#define OLED_DC 4
//#define OLED_CS 5
//#define OLED_CLK 2
//#define OLED_MOSI 3
//#define OLED_RESET 6
//Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
//* Uncomment this block to use hardware SPI
#define OLED_DC 4
#define OLED_CS 17 //NEW D17
#define OLED_RESET 12
Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);
//*/
#define NUMFLAKES 10