Hi all,
I create a project for a friend to show his name in Mandalorian in an OLED SSD1306. I checked on my Uno and everything works fine the problem starts when I swich to a NANO using the same code and same cables and the OLED is not working. I did and I2C scan and nothing shows up. I also checked that my oled supports 3.3 and 5 VCC. So I running out of options honestly don't know what else to do.
Thanks
Welcome to the forum
For the purpose that you describe the Uno and Nano (assuming that it is a classic Nano) are functionally the same, so the code and associated hardware should work on both
Please confirm that you are using a classic Nano
Which one?
Did you try switching back to the Uno to verify wiring is correct?
Post a link to the technical information on the Nano you are using, there are many varieties called NANO and they are not all comparable with each other or the UNO.
Which Nano?
Nano classic (the one with the same processor as the Uno R3, and the one we usually assume people mean when they say "Nano")?
Nano ESP32?
Nano 33 BLE?
Nano 33 BLE Sense?
Nano 33 BLE Sense Rev2?
Nano Every?
Nano 33 IoT?
Nano RP2040 Connect?
Sorry I should've known and post more info.
I'm using the classic NANO.
I switch several times between boards to make sure that I didn't mess anything and every time get the same result, working on uno not on nano.
The circuit is quite simple cuz I'm using only an OLED so the 5V from the arduino same with ground and SDA to A4 SCL to A5
The code is the following
// Libraries
#include <Wire.h>
#include <Adafruit_GFX.h> // v1.11.9
#include <Adafruit_SSD1306.h> // v2.5.9
#include "Mandoa13pt7b.h"
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
//#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire);
void setup() {
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C, false, false)) {
#ifdef DEBUG
Serial.println(F("SSD1306 allocation failed"));
#endif
for(;;); // Don't proceed, loop forever
}
// Clear the buffer
display.clearDisplay();
display.setCursor(0, 40);
display.setTextColor(SSD1306_WHITE);
display.setFont(&Mandoa13pt7b);
display.write("LUCAS SOLLA");
display.display();
}
void loop() {
}
I got the vocabulary in another tab called Mandoa13pt7b. but not relevant to post
Thank you
Since you have verified your wiring, at this point, it's time to verify that all the pertinent Nano pins are functional. Try disconnecting A4, A5 and wiring each to an LED-resistor combo, and using Blink to make the LED flash. If they're working, (this is an even bigger grasp-at-straw), use the LED-resistor combo to verify that you have 5V and GND connections AT THE DISPLAY. If that is all satisfactory, I'd suggest another Nano.
One thing - what is the actual chip on your Nano - is it marked as "328P" - there are other clone variants, with no guarantee of identical timing for the OLED. A crisp, clear photo of the top of your Nano might help dispel this concern.
There is one more -- NANO (Fig-1) as marked on the Board based on 32-pin MEGA328P MCU (SMD TQFP package). It is functionally equivalent to Arduino UNO (based on 28-pin ATMEGA328P MCU DIP package) except that NANO has two more extra analog channels (A6 and A7).
Figure-1:
Are the connections to the Nano soldered? A common mistake is to buy a Nano without the header pins soldered on, then just sticking the wires or jumpers into the holes and hoping for a good connection.
well I did the little experiment to check if the pins A4 and A5 are ok and turns out that the led is not working. I was so sure the problem was in other place since the board is brand new that I didn't bother to check the pins, silly me. Problem solved.
Thanks alot for the comments and help
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.