Hello,
I am attempting to write a test to prove that (2) SparkFun Qwiic Micro OLED Breakout products can be run off the same board. However, I am running into an issue where it is not compiling correctly.
First, before I go into the code, resulting error message, and troubleshooting steps taken, I first want to establish the components I’m using and basic tests I’ve already performed:
Components:
Address Change Test/Proof:
Here is what I have done and have been able to prove so far, before my two (2) screen test:
After proving that the Jumper definition worked, I went to work pairing down the MicroOLED_Demo_I2C code (removed some parts of the demo) and adjusted it to what I thought would run different parts of the demo on the two (2) screens. And came up with the following code:
Paired Down MicroOLED_Demo_I2C for two (2) Screens:
#include <Wire.h> // Include Wire if you're using I2C
#include <SFE_MicroOLED.h> // Include the SFE_MicroOLED library
//////////////////////////
// MicroOLED Definition //
//////////////////////////
//The library assumes a reset pin is necessary. The Qwiic OLED has RST hard-wired, so pick an arbitrary IO pin that is not being used
#define PIN_RESET_OPEN_DEFAULT_SCREEN 9
#define PIN_RESET_CLOSED_ADJUSTED_ADDRESS_SCREEN 10
//The DC_JUMPER is the I2C Address Select jumper. Set to 1 if the jumper is open (Default), or set to 0 if it's closed.
#define JUMPER_OPEN_DEFAULT_SCREEN 1
#define JUMPER_CLOSED_ADJUSTED_ADDRESS_SCREEN 0
//////////////////////////////////
// MicroOLED Object Declaration //
//////////////////////////////////
MicroOLED oledDEFAULTOPEN(PIN_RESET_OPEN_DEFAULT_SCREEN, JUMPER_OPEN_DEFAULT_SCREEN); // I2C declaration
MicroOLED oledCLOSEDADDRESSCHANGE(PIN_RESET_CLOSED_ADJUSTED_ADDRESS_SCREEN, JUMPER_CLOSED_ADJUSTED_ADDRESS_SCREEN); // I2C declaration
void setup()
{
delay(100);
Wire.begin();
oledDEFAULTOPEN.begin(); // Initialize the OLED
oledDEFAULTOPEN.clear(ALL); // Clear the display's internal memory
oledDEFAULTOPEN.display(); // Display what's in the buffer (splashscreen)
delay(1000); // Delay 1000 ms
oledDEFAULTOPEN.clear(PAGE); // Clear the buffer.
randomSeed(analogRead(A0) + analogRead(A1));
delay(100);
Wire.begin();
oledCLOSEDADDRESSCHANGE.begin(); // Initialize the OLED
oledCLOSEDADDRESSCHANGE.clear(ALL); // Clear the display's internal memory
oledCLOSEDADDRESSCHANGE.display(); // Display what's in the buffer (splashscreen)
delay(1000); // Delay 1000 ms
oledCLOSEDADDRESSCHANGE.clear(PAGE); // Clear the buffer.
randomSeed(analogRead(A0) + analogRead(A1));
}
void pixelExample()
{
for (int i=0; i<512; i++)
{
oledDEFAULTOPEN.pixel(random(oledDEFAULTOPEN.getLCDWidth()), random(oledDEFAULTOPEN.getLCDHeight()));
oledDEFAULTOPEN.display();
}
}
void lineExample()
{
int middleX = oledCLOSEDADDRESSCHANGE.getLCDWidth() / 2;
int middleY = oledCLOSEDADDRESSCHANGE.getLCDHeight() / 2;
int xEnd, yEnd;
int lineWidth = min(middleX, middleY);
for (int i=0; i<3; i++)
{
for (int deg=0; deg<360; deg+=15)
{
xEnd = lineWidth * cos(deg * PI / 180.0);
yEnd = lineWidth * sin(deg * PI / 180.0);
oledCLOSEDADDRESSCHANGE.line(middleX, middleY, middleX + xEnd, middleY + yEnd);
oledCLOSEDADDRESSCHANGE.display();
delay(10);
}
for (int deg=0; deg<360; deg+=15)
{
xEnd = lineWidth * cos(deg * PI / 180.0);
yEnd = lineWidth * sin(deg * PI / 180.0);
oledCLOSEDADDRESSCHANGE.line(middleX, middleY, middleX + xEnd, middleY + yEnd, BLACK, NORM);
oledCLOSEDADDRESSCHANGE.display();
delay(10);
}
}
}
After attempting to verify the code, I got the following error message:
Error Message:
C:\Users\nreis\AppData\Local\Temp\arduino_build_593296/arduino.ar(main.cpp.o):(.literal._Z8loopTaskPv+0x0): undefined reference to `loop()'
C:\Users\nreis\AppData\Local\Temp\arduino_build_593296/arduino.ar(main.cpp.o): In function `loopTask(void*)':
C:\Users\nreis\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\cores\esp32/main.cpp:15: undefined reference to `loop()'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Adafruit ESP32 Feather.
Basic Troubleshooting Steps Taken:
Conclusion:
Honestly, at this point, I’m curious if it’s even possible to run two (2) of the SparkFun Qwiic Micro OLED Breakout products off of the same board. If anyone has any idea of how to help me solve this error or write a better test to prove that (2) of the SparkFun Qwiic Micro OLED Breakout products can be run off the same board, it would be much appreciated! Otherwise, I’m at a loss at how to proceed, so any feedback is welcome!