0

RP2040 Feather and FW OLed 128x32
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

RP2040 Feather and FW OLed 128x32

by JarrodC on Sun Sep 12, 2021 11:04 pm

Hi There,

I bought a FW RP2040, and an FW Oled display and I've got them mounted on the Particle Ethernet FeatherWing, and I am using the Arduino IDE to code all of this.

Using the docs on Adafruit's site I was able to get all the needed libraries installed and I was able to get the example code for the Ethernet to work just fine. But then I decided to try and get the display to work, and I just feel like I am hitting a brick wall here and I cannot get it to work.

Some things that I am stuck on:

1. How do I translate the pins on the boards to that of the IDE arduino?

2. How can I get this display to work? Every example I have tried just leaves me with a blank screen, including the one here and here. I know exactly which pins on the boards to use, they are labeled 9, 6, 5, SCL and SDA, but again, how do I map those in the Arduino IDE?

It is also worth noting, that the Adafruit Feather OLED example does not compile, it errors out saying:
Code: Select all | TOGGLE FULL SIZE
<path>\Arduino\libraries\Adafruit_Feather_OLED\Adafruit_FeatherOLED_SH110X.cpp: In member function 'void Adafruit_FeatherOLED_SH110X::init()':
<path>\Arduino\libraries\Adafruit_Feather_OLED\Adafruit_FeatherOLED_SH110X.cpp:118:3: error: 'begin' was not declared in this scope
  118 |   begin(0x3C, true);
      |   ^~~~~
exit status 1
Error compiling for board Adafruit Feather RP2040



Thanks in advance for the help on this, it's been a pretty frustrating evening trying to work this out.

JarrodC
 
Posts: 9
Joined: Thu Apr 15, 2021 9:20 pm

Re: RP2040 Feather and FW OLed 128x32

by franklin97355 on Mon Sep 13, 2021 1:38 pm

What is the product number of the display?

franklin97355
 
Posts: 22241
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: RP2040 Feather and FW OLed 128x32

by JarrodC on Mon Sep 13, 2021 2:25 pm

franklin97355 wrote:What is the product number of the display?


It is this one: https://www.adafruit.com/product/2900 So I think the answer to your question is 2900.

JarrodC
 
Posts: 9
Joined: Thu Apr 15, 2021 9:20 pm

Re: RP2040 Feather and FW OLed 128x32

by JarrodC on Tue Sep 14, 2021 10:03 pm

No one? Really?

At any rate, I am now wondering if I have a defective unit. As near as I can tell it should work, but I just don't know.

JarrodC
 
Posts: 9
Joined: Thu Apr 15, 2021 9:20 pm

Re: RP2040 Feather and FW OLed 128x32

by adafruit2 on Wed Sep 15, 2021 11:27 am

Adafruit_FeatherOLED_SH110X is a different chipset (SH110x) not SSD1306, so that wouldn't work for sure.

you want to use

https://github.com/adafruit/Adafruit_SS ... erwing.ino

please try it. remove any extra hardware in case its affecting the oled!

adafruit2
Site Admin
 
Posts: 20259
Joined: Fri Mar 11, 2005 7:36 pm

Re: RP2040 Feather and FW OLed 128x32

by JarrodC on Sun Sep 19, 2021 2:58 pm

adafruit2 wrote:Adafruit_FeatherOLED_SH110X is a different chipset (SH110x) not SSD1306, so that wouldn't work for sure.

you want to use

https://github.com/adafruit/Adafruit_SS ... erwing.ino

please try it. remove any extra hardware in case its affecting the oled!


Thank you, I will give it a try.

How do you know it is a SH110X vs the SSH1306? There is no mention of this in the product page, and all the links to data sheets and tutorials go to the SSD1306 one. So I am wondering what I missed.

That code you linked is the same as the code I tried (and linked above), there are some minor differences in the structure, but overall it is the same. It also calls the SSH1306.h library, so I am very confused why you are calling out the SH110X, then using code that seems to be for the SSD1306. I will try the code you linked anyway.

Can I get some explanation on this so that I can learn about how to use this thing?

JarrodC
 
Posts: 9
Joined: Thu Apr 15, 2021 9:20 pm

Re: RP2040 Feather and FW OLed 128x32

by adafruit2 on Sun Sep 19, 2021 3:50 pm

PID 2900 is definitely a SSD1306
https://learn.adafruit.com/adafruit-ole ... g/download

the library you were using didnt match

adafruit2
Site Admin
 
Posts: 20259
Joined: Fri Mar 11, 2005 7:36 pm

Re: RP2040 Feather and FW OLed 128x32

by JarrodC on Sun Sep 19, 2021 7:04 pm

adafruit2 wrote:PID 2900 is definitely a SSD1306
https://learn.adafruit.com/adafruit-ole ... g/download

the library you were using didnt match


But the code you linked is the same as the code I tried to use, both have:

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_SSD1306.h>
(see the links in my original post to where I got code to try).

Or am I missing something obvious here? As near as I can tell there is no other library I tried to use.

EDIT: Ok, the built in example that gave me the errors I mentioned in my first post was using the wrong library. I get that now. But that does not change the fact that using the correct library and the example code does not do anything, the OLED is completely blank.

JarrodC
 
Posts: 9
Joined: Thu Apr 15, 2021 9:20 pm

Re: RP2040 Feather and FW OLed 128x32

by adafruit_support_carter on Wed Sep 22, 2021 2:30 pm

Look for this line at the top of the sketch:
Code: Select all | TOGGLE FULL SIZE
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 32, &Wire);

and change it to:
Code: Select all | TOGGLE FULL SIZE
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 32, &Wire1);

adafruit_support_carter
 
Posts: 21359
Joined: Tue Nov 29, 2016 2:45 pm

Re: RP2040 Feather and FW OLed 128x32

by JarrodC on Sat Sep 25, 2021 10:54 pm

adafruit_support_carter wrote:Look for this line at the top of the sketch:
Code: Select all | TOGGLE FULL SIZE
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 32, &Wire);

and change it to:
Code: Select all | TOGGLE FULL SIZE
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 32, &Wire1);


Did not seem to make a difference.

I know there is nothing wrong with the RP or the feather particle. I can get the ethernet to work just fine. This display just does not work at all, with the example code. I checked continuity on all the pins, and they are definitely connected to the RPI and there are no shorts that I can find.

Starting to think I have a bad piece of hardware, but I've no idea how to confirm this, and the terse responses on here, with zero explanation, are not helping much, though I do appreciate the attempts.

JarrodC
 
Posts: 9
Joined: Thu Apr 15, 2021 9:20 pm

Re: RP2040 Feather and FW OLed 128x32

by adafruit2 on Sun Sep 26, 2021 8:34 am

please post a pic of your setup, that will help figure out whats up!

adafruit2
Site Admin
 
Posts: 20259
Joined: Fri Mar 11, 2005 7:36 pm

Re: RP2040 Feather and FW OLed 128x32

by adafruit_support_carter on Sun Sep 26, 2021 11:27 am

Here's a complete version of the sketch known to work on the Feather RP2040.

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_SSD1306.h>

Adafruit_SSD1306 display = Adafruit_SSD1306(128, 32, &Wire1);

#define BUTTON_A  9
#define BUTTON_B  8
#define BUTTON_C  7
 
void setup() {
  Serial.begin(9600);
  //while (!Serial);

  Serial.println("OLED FeatherWing test");

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Address 0x3C for 128x32

  Serial.println("OLED begun");

  // Show image buffer on the display hardware.
  // Since the buffer is intialized with an Adafruit splashscreen
  // internally, this will display the splashscreen.
  display.display();
  delay(1000);

  // Clear the buffer.
  display.clearDisplay();
  display.display();

  Serial.println("IO test");

  pinMode(BUTTON_A, INPUT_PULLUP);
  pinMode(BUTTON_B, INPUT_PULLUP);
  pinMode(BUTTON_C, INPUT_PULLUP);

  // text display tests
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0,0);
  display.print("Connecting to SSID\n'adafruit':");
  display.print("connected!");
  display.println("IP: 10.0.1.23");
  display.println("Sending val #0");
  display.setCursor(0,0);
  display.display(); // actually display all of the above
}

void loop() {
  if(!digitalRead(BUTTON_A)) display.print("A");
  if(!digitalRead(BUTTON_B)) display.print("B");
  if(!digitalRead(BUTTON_C)) display.print("C");
  delay(10);
  yield();
  display.display();
}


rp2040_oled.jpg
rp2040_oled.jpg (617.81 KiB) Viewed 20 times

adafruit_support_carter
 
Posts: 21359
Joined: Tue Nov 29, 2016 2:45 pm

Re: RP2040 Feather and FW OLed 128x32

by JarrodC on Sun Sep 26, 2021 4:28 pm

The Arduino IDE told me that there were some updates for my libraries, included with it was some Adafruit library updates, including the SH110x and graphics libraries, there was also a new update for the RPI board (the one by Earle Philhower), so I installed all of those.

That, coupled with changing to
Code: Select all | TOGGLE FULL SIZE
&wire1
seems to have gotten things working.

@adafruit_support_carter - Thanks for the verified code, that helped me solve another issue, only the A button was working once I got the display lit up, and this was due to the pin numbers being wrong in the other example sketch, or at least wrong for the RPI.

How does one translate the pins on the RPI board into the numbers used in the Arduino IDE? I just can't seem to work out how to correlate the physical pin with one in the code.

Thanks,

JarrodC
 
Posts: 9
Joined: Thu Apr 15, 2021 9:20 pm

Re: RP2040 Feather and FW OLed 128x32

by JarrodC on Sun Sep 26, 2021 4:33 pm

adafruit2 wrote:please post a pic of your setup, that will help figure out whats up!


Here you go.
Attachments
PXL_20210926_202914278.jpg
PXL_20210926_202914278.jpg (970.02 KiB) Viewed 15 times

JarrodC
 
Posts: 9
Joined: Thu Apr 15, 2021 9:20 pm

Re: RP2040 Feather and FW OLed 128x32

by adafruit_support_carter on Sun Sep 26, 2021 6:43 pm

How does one translate the pins on the RPI board into the numbers used in the Arduino IDE?

In general, you can just use the numbers labeled next to the pin on the board itself. The little white printed labels. The Learn guides also include a pinout diagram and other info:
https://learn.adafruit.com/adafruit-fea ... co/pinouts

In this specific case, I think there is currently an issue with the assignments for pins 4, 5, and 6 in the Arduino core for the Feather RP2040. Two of those are pins used for the OLED buttons, so it added some extra confusion.

adafruit_support_carter
 
Posts: 21359
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.