From e59d1bee421b11353c0e85dabe3262993565f1b5 Mon Sep 17 00:00:00 2001 From: Steve Lascos Date: Sat, 8 Feb 2025 11:41:21 -0500 Subject: [PATCH] Switch from custom Aviate OLED library to public Adafruit library for SH1106 --- .../Multiverse_BasicDemo.ino | 16 ++++++++-------- .../Multiverse_BasicDemo/PhysicalControls.cpp | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/Tests/Multiverse_BasicDemo/Multiverse_BasicDemo.ino b/examples/Tests/Multiverse_BasicDemo/Multiverse_BasicDemo.ino index fb45193..e06a6ee 100644 --- a/examples/Tests/Multiverse_BasicDemo/Multiverse_BasicDemo.ino +++ b/examples/Tests/Multiverse_BasicDemo/Multiverse_BasicDemo.ino @@ -12,16 +12,16 @@ * * REQUIREMENTS: * This demo for Multiverse uses its OLED display which requires several Arduino - * libraries be downloaded first. The SH1106 library is modifed to work with Teensy - * and must be downloaded from the AviateAudio github link below. + * libraries be downloaded first. These can also be installed from the Arduino Libraries + * Manager in the Arduino IDE. * * If you do not wish to use the OLED display, or run into difficulties you can * comment out the #define USE_OLED line in PhysicalControls.h to avoid the need for - * the Adafruit/Aviate dependencies. + * the Adafruit dependencies. * * Adafruit_BusIO : https://github.com/adafruit/Adafruit_BusIO (tested with v1.17) * Adafruit_GFX_Library : https://github.com/adafruit/Adafruit-GFX-Library (tested with v1.11.11) - * Adafruit_SH1106 : https://github.com/AviateAudio/Adafruit_SH1106 + * Adafruit_SH110X : https://github.com/adafruit/Adafruit_SH110x (tested with 2.1.11) * * * USAGE INSTRUCTIONS @@ -42,12 +42,12 @@ using namespace BALibrary; // OLED display stuff #ifdef USE_OLED -#include "Adafruit_SH1106.h" +#include "Adafruit_SH110X.h" #include "Adafruit_GFX.h" #include "Fonts/FreeSansBold9pt7b.h" constexpr unsigned SCREEN_WIDTH = 128; // OLED display width, in pixels constexpr unsigned SCREEN_HEIGHT = 64; // OLED display height, in pixels -Adafruit_SH1106 display(37, 35, 10); +Adafruit_SH1106G display(SCREEN_WIDTH, SCREEN_HEIGHT, &SPI, 37 /*DC*/, 35 /*RST*/, 10 /*CS*/); #endif // USE_OLED // External SPI RAM @@ -108,10 +108,10 @@ void setup() { #ifdef USE_OLED // Init the display - display.begin(SH1106_SWITCHCAPVCC, SH1106_I2C_ADDRESS, true); + display.begin(0x3C /* SH1106_I2C_ADDRESS */, true); display.clearDisplay(); display.display(); - display.setTextColor(WHITE); // Draw white text + display.setTextColor(SH110X_WHITE); // Draw white text display.setFont(&FreeSansBold9pt7b); drawBlackaddrAudio(); display.display(); diff --git a/examples/Tests/Multiverse_BasicDemo/PhysicalControls.cpp b/examples/Tests/Multiverse_BasicDemo/PhysicalControls.cpp index cc5ba36..b825e62 100644 --- a/examples/Tests/Multiverse_BasicDemo/PhysicalControls.cpp +++ b/examples/Tests/Multiverse_BasicDemo/PhysicalControls.cpp @@ -1,5 +1,5 @@ #include -#include "Adafruit_SH1106.h" +#include "Adafruit_SH110X.h" #include "BALibrary.h" #include "DebugPrintf.h" #include "PhysicalControls.h" @@ -8,7 +8,7 @@ using namespace BALibrary; // Declare the externally shared variables from the main .ino #ifdef USE_OLED -extern Adafruit_SH1106 display; +extern Adafruit_SH1106G display; #endif extern BAAudioControlWM8731master codec; extern AudioMixer4 volumeOut;