Adafruit_SSD1306 Library Compiling Issues - Argon

Hello everyone. I am having issues setting up the Adafruit OLED FeatherWing 128x32 display. Every time that I compile, it produces several errors, notably:

 warning: "ARDUINO" is not defined

error: class 'Adafruit_SSD1306' does not have any field named 'restoreClk'
  178 |   wireClk(clkDuring), restoreClk(clkAfter) {

#define WIRE_WRITE wire->send  ///< Wire write function in older Arduino lib

See terminal log, below.

I am trying to flash the default demo code that is included in the manual for OLED (LINK). This text will be hidden

Do I need to downgrade my OS firmware version for the project/Argon board? I have read through several other feeds and was unable to find a solution.

:::: PUTTING DEVICE INTO DFU MODE

Done.

:::: FLASHING APPLICATION

Creating /Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/target/2.0.0/argon/platform_user_ram.ld ...
In file included from /Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/src/Test_2.ino:12:
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.h:41: warning: "SPI_HAS_TRANSACTION" redefined
   41 | #define SPI_HAS_TRANSACTION
      | 
In file included from ./inc/application.h:95,
                 from ./inc/Particle.h:5,
                 from /Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2//src/Test_2.cpp:5:
../wiring/inc/spark_wiring_arduino.h:76: note: this is the location of the previous definition
   76 | #define SPI_HAS_TRANSACTION (1)
      | 
In file included from /Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/src/Test_2.ino:12:
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.h:44: warning: "SPI_HAS_TRANSACTION" redefined
   44 | #define SPI_HAS_TRANSACTION 1
      | 
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.h:41: note: this is the location of the previous definition
   41 | #define SPI_HAS_TRANSACTION
      | 
In file included from /Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:52:
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.h:41: warning: "SPI_HAS_TRANSACTION" redefined
   41 | #define SPI_HAS_TRANSACTION
      | 
In file included from ./inc/application.h:95,
                 from /Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_GFX/src/Adafruit_GFX.h:4,
                 from /Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:51:
../wiring/inc/spark_wiring_arduino.h:76: note: this is the location of the previous definition
   76 | #define SPI_HAS_TRANSACTION (1)
      | 
In file included from /Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:52:
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.h:44: warning: "SPI_HAS_TRANSACTION" redefined
   44 | #define SPI_HAS_TRANSACTION 1
      | 
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.h:41: note: this is the location of the previous definition
   41 | #define SPI_HAS_TRANSACTION
      | 
In file included from /Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:52:
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.h:201:5: warning: "ARDUINO" is not defined, evaluates to 0 [-Wundef]
  201 | #if ARDUINO >= 157
      |     ^~~~~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:68:5: warning: "ARDUINO" is not defined, evaluates to 0 [-Wundef]
   68 | #if ARDUINO >= 100
      |     ^~~~~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:86:6: warning: "ARDUINO" is not defined, evaluates to 0 [-Wundef]
   86 | #if (ARDUINO >= 157) && !defined(ARDUINO_STM32_FEATHER)
      |      ^~~~~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp: In constructor 'Adafruit_SSD1306::Adafruit_SSD1306(uint8_t, uint8_t, TwoWire*, int8_t, uint32_t, uint32_t)':
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:178:3: error: class 'Adafruit_SSD1306' does not have any field named 'wireClk'
  178 |   wireClk(clkDuring), restoreClk(clkAfter) {
      |   ^~~~~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:178:23: error: class 'Adafruit_SSD1306' does not have any field named 'restoreClk'
  178 |   wireClk(clkDuring), restoreClk(clkAfter) {
      |                       ^~~~~~~~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp: In member function 'void Adafruit_SSD1306::ssd1306_command1(uint8_t)':
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:71:27: error: 'class TwoWire' has no member named 'send'; did you mean 'end'?
   71 |  #define WIRE_WRITE wire->send  ///< Wire write function in older Arduino lib
      |                           ^~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:373:5: note: in expansion of macro 'WIRE_WRITE'
  373 |     WIRE_WRITE((uint8_t)0x00); // Co = 0, D/C = 0
      |     ^~~~~~~~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:71:27: error: 'class TwoWire' has no member named 'send'; did you mean 'end'?
   71 |  #define WIRE_WRITE wire->send  ///< Wire write function in older Arduino lib
      |                           ^~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:374:5: note: in expansion of macro 'WIRE_WRITE'
  374 |     WIRE_WRITE(c);
      |     ^~~~~~~~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp: In member function 'void Adafruit_SSD1306::ssd1306_commandList(const uint8_t*, uint8_t)':
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:71:27: error: 'class TwoWire' has no member named 'send'; did you mean 'end'?
   71 |  #define WIRE_WRITE wire->send  ///< Wire write function in older Arduino lib
      |                           ^~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:387:5: note: in expansion of macro 'WIRE_WRITE'
  387 |     WIRE_WRITE((uint8_t)0x00); // Co = 0, D/C = 0
      |     ^~~~~~~~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:71:27: error: 'class TwoWire' has no member named 'send'; did you mean 'end'?
   71 |  #define WIRE_WRITE wire->send  ///< Wire write function in older Arduino lib
      |                           ^~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:393:9: note: in expansion of macro 'WIRE_WRITE'
  393 |         WIRE_WRITE((uint8_t)0x00); // Co = 0, D/C = 0
      |         ^~~~~~~~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:71:27: error: 'class TwoWire' has no member named 'send'; did you mean 'end'?
   71 |  #define WIRE_WRITE wire->send  ///< Wire write function in older Arduino lib
      |                           ^~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:396:7: note: in expansion of macro 'WIRE_WRITE'
  396 |       WIRE_WRITE(pgm_read_byte(c++));
      |       ^~~~~~~~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp: In member function 'void Adafruit_SSD1306::display()':
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:71:27: error: 'class TwoWire' has no member named 'send'; did you mean 'end'?
   71 |  #define WIRE_WRITE wire->send  ///< Wire write function in older Arduino lib
      |                           ^~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:918:5: note: in expansion of macro 'WIRE_WRITE'
  918 |     WIRE_WRITE((uint8_t)0x40);
      |     ^~~~~~~~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:71:27: error: 'class TwoWire' has no member named 'send'; did you mean 'end'?
   71 |  #define WIRE_WRITE wire->send  ///< Wire write function in older Arduino lib
      |                           ^~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:924:9: note: in expansion of macro 'WIRE_WRITE'
  924 |         WIRE_WRITE((uint8_t)0x40);
      |         ^~~~~~~~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:71:27: error: 'class TwoWire' has no member named 'send'; did you mean 'end'?
   71 |  #define WIRE_WRITE wire->send  ///< Wire write function in older Arduino lib
      |                           ^~~~
/Users/michael/OneDrive/Projects/Capstone_Code/Test_Dist/Test_2/lib/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.cpp:927:7: note: in expansion of macro 'WIRE_WRITE'
  927 |       WIRE_WRITE(*ptr++);
      |       ^~~~~~~~~~
make[3]: *** [../build/target/user/platform-12-m/Test_2/Adafruit_SSD1306_RK/src/Adafruit_SSD1306.o] Error 1
make[2]: *** [user] Error 2
make[1]: *** [modules/argon/user-part] Error 2
make: *** [flash-user] Error 2
The terminal process "/bin/bash '-c', 'make -f '/Users/michael/.particle/toolchains/buildscripts/1.9.2/Makefile' flash-user -s'" terminated with exit code: 2.

How about testing one of the samples that comes with the library?
I²C
SPI
Since these build fine, you may want to compare what your code does against how it should be done :wink:

You may also state which device OS version you are building for.

1 Like

Are you using the WebIDE? I’m guessing the same libraries are available for the desktop IDE, but I’ve not tried the SSD1306 using that. From the web, I just search for and include the default library, which I have used on Xenons and Argons up to 1.5.x.

This is using an I2C version directly and not the featherwing.

#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

void setup() {
    Particle.publish("Start", "Started OLED_AND_INA219");
    
    // Init display
    display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
    
    // Clear display
    display.clearDisplay();
    display.setTextSize(3);
    display.setTextColor(WHITE);
    display.setCursor(0,0);
    display.println("Hello");
    display.setCursor(0,24);
    display.println("World!");
    display.display();
    delay(2000);
    
    display.clearDisplay();
    display.display();
}

Sure, all libraries available for WebIDE can also be used with Particle Workbench.

Okay. I’ll try downgrading my firmware version and see if that works.