Can RX/TX be used for I2C OLED?

In the course of playing with other hardware, I’ve come across libraries that allow you to define different IOs for the I2C bus. So for e.g. on the wemos D1 mini, because 5V, GND, D4, D3 are the ducks sitting in a line, I could change the display I2C pins using SSD1306Wire display(0x3c, D3, D4); I hope to do the same with the Photon because this makes it extremely convenient to plug in the el cheapo 128x64 OLED LCDs for ez serial debugging (using VIN, GND, RX, TX) without having to jumper anything. I wonder if this is something native to the board or using the D1, D0 clock pins are a must?

Disclaimer: I’m very naive to board layouts and designs but sensitive to quality-of-life improvements

The ESP controllers have a very flexible GPIO assignment feature where you can virtually have any pin do anything. So it’s not a feature actually provided by the display library but an enhanced feature of the Wire implementation on ESP controllers.
However, neither the STM32 used on Particel Gen1&2 devices nor the nRF controllers used for Gen3 offer that flexibility.

However, you can use D2 as GND and D3 as Vin to achieve virtually the same effect (at the expense of two more GPIOs).

1 Like

Thanks! That was my quick alternative!

That said, the SSD1306 user-contributed particle libraries are really in a mess @Library Dead Link - ADAFRUIT_SSD1306.

It’s got like 160k downloads and probably 90k more compilation failures. Surely that library should be taken off?

Am I missing something but what is everyone using for a console other than Particle.Publish?

Yup!
e.g. the link posted at the end of the thread you linked to :wink:

As for the "original" library there are also some threads in this forum talking about how to make the "broken" library build (BTW, it's only the examples and only one build error AFAICT which is easily fixed by removing the double implementation of random() in the examples).

I included Rickas’ library in my code of the web IDE and it fired up the same error as the main one.

clamper.ino:2:33: Adafruit_SSD1306_RK.h: No such file or directory

and yes I’ve included the library as a first liner on my source file (actually its auto-included). But I can compile and flash the library’s example.ino. I’m scratching my head here.

Also, is there particle-dev plugin for the atom IDE still supported? I’ve tried installing that and got an error as well.

If you can provide a SHARE THIS REVISION link to your project I may be able to make it build.

BTW, what device OS version are you targeting?

Absolutely!

I believe the device OS is the default 1.1.0

I see you have include statements for both libraries (Adafruit_SSD1306_RK.h and Adafruit_SSD1306.h) but have only the _RK version imported.
You also have #include Adafruit_GFX.h but that library is not imported and not needed either.

After correcting that and also some minor tweaks this builds for me
https://go.particle.io/shared_apps/5ce6b9c62968fb0022b1f247

Could I ask what were the minor tweaks? I removed those two statements and also tried copying your version wholesale but its still trying at the same error, :

clamper.ino:4:33: Adafruit_SSD1306_RK.h: No such file or directory

here’s the revised version: https://go.particle.io/shared_apps/5ce6bc822968fb0022b1f278

Thanks again!

  • I changed your #include "application.h" to #include "Particle.h" (which is the new name)
  • I moved the #include <photon-thermistor.h> from photon-heater.cpp to photon-heater.h
  • reordered the include statments and removed redundant comments

But these minor tweaks won’t solve your issue.
Your project has got to a state where you’d need a clean build which the Web IDE doesn’t offer.
One of the step I made to make the project build was to start with a completely fresh project and copy/paste your three source files over.
After that I imported the libraries.

So the easierst for you would be to use my revision and build ontop of that.

2 Likes

Oh my, that actually worked! Are there any alternatives to the web IDE? This is honestly something that shouldn’t happen.

Thank you so much again!

I’d suggest Particle Workbench (VS Code based online/offline build tool).

1 Like

Thanks! I’ll look into it right now! Thanks again @ScruffR! This was exactly what I was hoping for - finally got to see the serial monitor *whiff whiff.