OLED 1309 compilation errors

This is the display I am using...

I have loaded the Adafruit 1306 library and modified it as instructed to select the 128x64 parameters.
Processor in use is a clone NANO although I believe that to be irrelevant at this stage.

On my system at home, I had failed compilation, it exits with "status 1" before it gets to upload, which is why I don't think it is processor specific. To test that theory, I also tried to compile for a Teensy 4.0 which gave the same errors.

The sketch I am trying is the one from the seller's Ebay page, copied and pasted.

Today, I started afresh at the office, brand new installation of the IDE and loaded the Adafruit 1306 library. Once again, the same compilation error occurs. Looking at the log, it suggests that the library has issues, or it isn't getting the parameters it wants.

I wonder if anyone can tell me where I am going wrong please?

Arduino: 1.8.12 (Windows 10), Board: "Arduino Nano, ATmega328P"


                                          ^



C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note:   candidate expects 0 arguments, 2 provided

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note: candidate: constexpr Adafruit_GFX::Adafruit_GFX(const Adafruit_GFX&)

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note:   candidate expects 1 argument, 2 provided

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note: candidate: constexpr Adafruit_GFX::Adafruit_GFX(Adafruit_GFX&&)

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note:   candidate expects 1 argument, 2 provided

C:\Users\User\Documents\Arduino\libraries\Adafruit_SSD1306\Adafruit_SSD1306.cpp: In constructor 'Adafruit_SSD1306::Adafruit_SSD1306(int8_t, int8_t, int8_t)':

C:\Users\User\Documents\Arduino\libraries\Adafruit_SSD1306\Adafruit_SSD1306.cpp:302:47: error: no matching function for call to 'Adafruit_GFX::Adafruit_GFX(int, int)'

 dcPin(dc_pin), csPin(cs_pin), rstPin(rst_pin) {

                                             ^

In file included from C:\Users\User\Documents\Arduino\libraries\Adafruit_SSD1306\Adafruit_SSD1306.cpp:51:0:

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note: candidate: Adafruit_GFX::Adafruit_GFX()

class Adafruit_GFX : public Print {

     ^~~~~~~~~~~~

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note:   candidate expects 0 arguments, 2 provided

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note: candidate: constexpr Adafruit_GFX::Adafruit_GFX(const Adafruit_GFX&)

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note:   candidate expects 1 argument, 2 provided

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note: candidate: constexpr Adafruit_GFX::Adafruit_GFX(Adafruit_GFX&&)

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note:   candidate expects 1 argument, 2 provided

C:\Users\User\Documents\Arduino\libraries\Adafruit_SSD1306\Adafruit_SSD1306.cpp: In constructor 'Adafruit_SSD1306::Adafruit_SSD1306(int8_t)':

C:\Users\User\Documents\Arduino\libraries\Adafruit_SSD1306\Adafruit_SSD1306.cpp:325:17: error: no matching function for call to 'Adafruit_GFX::Adafruit_GFX(int, int)'

 rstPin(rst_pin) {

               ^

In file included from C:\Users\User\Documents\Arduino\libraries\Adafruit_SSD1306\Adafruit_SSD1306.cpp:51:0:

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note: candidate: Adafruit_GFX::Adafruit_GFX()

class Adafruit_GFX : public Print {

     ^~~~~~~~~~~~

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note:   candidate expects 0 arguments, 2 provided

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note: candidate: constexpr Adafruit_GFX::Adafruit_GFX(const Adafruit_GFX&)

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note:   candidate expects 1 argument, 2 provided

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note: candidate: constexpr Adafruit_GFX::Adafruit_GFX(Adafruit_GFX&&)

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX/Adafruit_GFX.h:28:7: note:   candidate expects 1 argument, 2 provided

Multiple libraries were found for "Wire.h"
Used: C:\Program Files\Arduino\hardware\arduino\avr\libraries\Wire
Not used: C:\Users\User\Documents\Arduino\libraries\Wire
Multiple libraries were found for "SPI.h"
Used: C:\Program Files\Arduino\hardware\arduino\avr\libraries\SPI
Not used: C:\Users\User\Documents\Arduino\libraries\SPI
Multiple libraries were found for "Adafruit_GFX.h"
Used: C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX
Not used: C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX_Library
Using library Adafruit_SSD1306 at version 2.2.0 in folder: C:\Users\User\Documents\Arduino\libraries\Adafruit_SSD1306 
Using library Wire at version 1.0 in folder: C:\Program Files\Arduino\hardware\arduino\avr\libraries\Wire 
Using library SPI at version 1.0 in folder: C:\Program Files\Arduino\hardware\arduino\avr\libraries\SPI 
Using library Adafruit_GFX in folder: C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX (legacy)
exit status 1
Error compiling for board Arduino Nano.

Sort out your multiple library problem first:

  1. Leave IDE.
  2. Delete wrong "user" folders.
  3. Start IDE.
  4. Install Adafruit_SSD1306 and Adafruit_GFX via IDE Library Manager.

These are correct:

Using library Wire at version 1.0 in folder: C:\Program Files\Arduino\hardware\arduino\avr\libraries\Wire
Using library SPI at version 1.0 in folder: C:\Program Files\Arduino\hardware\arduino\avr\libraries\SPI

It is safer to delete suspect user libraries and install the correct ones.

I would be suspicious of using Adafruit_SSD1306 init code for a SSD1309.
Much better to use U8g2 code which supports SSD1309.

David.

Thankyou David, I will have another fiddle tonight, although those errors are on my office PC. Gives me a clue what I am looking for though and I will take your advice.

Adafruit_SSD1306 does not have a setContrast() method like u8g2.
But you can write your own with ssd1306_command() e.g.

   display.ssd1306_command(0x81);  //contrast command
   display.ssd1306_command(0x6F);  //contrast value.   I would choose values from 0x10 - 0x6F

The SSD1306 sketch from the shop builds correctly when the correct libraries are installed.

David.

Thanks David. My brain hurts now!

I found that the last IDE install had put everything into programsx86 including a library directory. I removed all the documents/arduino libraries and tried again after a restart. I was able to make it compile this time but not run correctly.

My attention switched to a different project which uses the 1325 library and I successfully loaded that into a Teensy 3.6. The display was corrupt of course, so I changed the references to load the Adafruit 1306 library. That compiled and gave me a display which was stretched vertically, no doubt because the correct setting hadn't been made in the header file. I tweaked that and it then failed compilation at the #defines which showed that it had lost track of the libraries for some reason. I ran Teensyduino again which reloaded the libraries to programsx86 but still the IDE was unable to see them.

Next step was to uninstall the lot and re-install to my documents/arduino directory. The preferences are set to see the sketchbook there already. Now the IDE starts to boot and then does nothing else. File associations have also gone west so I have given up for now.

Piggin' PCs :slight_smile:

Sit down with a nice cup of tea.

Install the IDE from Arduino.cc e.g. from this Forum website.

The IDE comes with several “system” libraries which it will probably put in “C:/Program Files”
You do not alter these. If you upgrade the IDE, the “IDE upgrade” will come with a new set.

The “User libraries” are installed by running the IDE Library Manager.
The Library Manager will check version numbers and install in the correct place on your PC. i.e. in your User sketch folder.

Do not attempt to copy Teensy files. Always use the Library Manager.
Teensy libraries tend to be modified for Teensy and generally out of date with the original author. You should use them for Teensy and nothing else.

If you have a problem, copy the build report into a TXT file and attach it to your message.

David.

Let's see if I am understanding this properly:

The Arduino doesn't just have one library?

It uses a default library which is installed into programsX86 with an admin install, used for the core libraries?

It uses another which follows the path sketchbook/libraries that holds user added libraries?

My next steps therefore must be, delete everything. Clean it all out with CC Cleaner etc and then do a fresh IDE install on the admin option.

Bring up a sketch window, select Library Manager and search for / install my additional libraries. Those will end up in the sketchbook/libraries directory.

This is all far too complex you know! In the 80s I was one of the main Acorn Computer dealers for the area. I was brought up on BBC Basic / Assembler and then RISC OS. It just worked and virtually everything required by a program was in its own directory. I still use RISC OS machines and an emulated version on the PC to do networked Caller ID, DTP and accounts etc.

No it is not complex.

The regular user just downloads and installs Arduino IDE and runs the built-in examples.
When she wants to use a third-party library, she runs the Library Manager. Installs the library(s)

Runs all the examples that come with the third-party library.
Then adapts the examples or writes her own sketches.

She is a happy bunny.

The problems are with the "ex-Dealer, ex-developer, ex-professional".
She chooses to copy code, libraries, from suspect locations on the Internet to random places on her PC.
And then wonders why it does not work.

This is all far too complex you know!

It is even more worrying when they choose to

Clean it all out with CC Cleaner etc and then do a fresh IDE install on the admin option.

David.

Fair comment, appreciate your patience with me, however, I didn't choose to install to the different locations. The .zip library installations I have done over the last few years appear to have done that. I'm just trying to get everything back to a standard install now, so I have to clear out surplus libraries to stop them being seen.

Which library location is the default then?

I have been using the "Add .zip library" option at times and that also has been putting them into documents/sketchbook. Clearly that is incorect so will revert to only using the library manager.

Why are there two versions of the IDE for Windows please, one a .zip and the other an "admin" install?

My suggestion to clean it all out was to start from fresh, without any remnants of anything lurking to confuse things.

Yes, a fresh start is a good idea (tm)

I suggest that you always use the IDE Library Manager.
Only "install from ZIP" if there is no alternative. (or the Author has specifically asked you to)

David.

That mess is now sorted and I have recompiled successfully, many thanks. I have also been able to get the display's aspect ratio sorted. Something else has bitten my rear now, but I have it under control I believe. It's the Teensy audio board. I found out the hard way that revision C and D are wired differently!

It is all working.

It looks like you are using a Teensy. And the Teensy probably came with its own hack of Adafruit_SSDD1306 and Adafruit_GFX.

Anyway, the build report will tell you which libraries were used.

I am a little concerned about the big SSD1309 drawing a high current because it is using the SSD1306 contrast setting.

Draw WHITE to the whole display e.g. fillScreen()
Measure the total current used by your project. It should be less than 100mA.

Does the screen get warm?

David.