It’s an honor to be a part of your Community may i say. I Have a myriad of LCD’s that i have
purchased for arduino, but so far i can only get the Numbers only Red-Light ones to work.
A week or so ago i purchased this one :
Tiny little LCD, seems to be able to display text, and has only four pins. Can you guys give me some
simple code or tell me what i need to do to display ‘Hello World’ on this little LCD screeno. Cheers.!.
You might try a suitable Arduino library. Libs are available in the Library Manager of the Arduino IDE. Best is to search for the controller name, which is SSD1306 in your case (from your link).
Here is a web page, which compares two (most important?) libraries:
I try to follow, as I am interested in OLED displays as well.
The controller of the display was not obvious to me, from the link of the orignal post.
So I assume you just know what the controller of this display must be, maybe from the pixel resolution.
Can you give us some idea how to guess the controller, if the seller doesn't mention it, or if it might be wrong, for OLEDS ? I know that for TFT this is nearly impossible.
Thank you for your excellent and very welcome work!
The controller was mentioned on the ebay site itself.
But it is true, in case of a 128x64 or 128x32 OLED it will usually be a SSD1306 or SH1106 controller.
Bigger OLEDs (higher resolution) will have SSD132x type of controller.
I was not really struck with blindness yesterday, but I need to learn to read - read ebay pages.
I had opened that page several times, but did not scroll down enough.
Thank you for the information; so these are the controllers I should take a look at the specifications, to see the similarities and differences compared to TFT controllers.
U8g2 will be my choice for my OLEDS and other monochrome displays, to reduce the number of libraries in my Arduino folder.
Thank you so much for your kindly response. I Have read through all of those links you
have given me but i am still stuck halfway. The small OLED in the link i sent you, has four
GND: Power Ground
VCC: Power + (DC 3.3 ~5v)
SCL: Clock Line
SDA: Data Lin
The first two are obvious as to their position on the Arduino, would you be so kind as to
demonstrate a "Hello World" on the small four-pin OLED and tell me where to put SCL and SDA.
... and tell me where to put SCL and SDA.
U8g2 offerst two options for wiring I2C devices:
- Software emulated I2C (SW_I2C)
- Hardware driven I2C communication (HW_I2C)
Software emulated I2C communicaton is more flexible (you can use any GPIO pin).
Hardware I2C communication requires that the pins are connected to the SDA/SCL pins of your board.
Lets assume you want to use software emulated I2C. Then just connect SCL and SDA to any GPIO port, then uncomment and update the u8g2 constructor:
U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* SCL=*/ 13, /* SDA=*/ 11);
In this case, I assume that SCL is connected to pin 13 and SDA is connected to pin 11. In other words, you connect as you want, but you will also tell U8g2 how your display is connected.
From perspective of u8g2, the hardware driven I2C communication is even simpler. Because the pins are fixed as per your board, the constructor is just:
I've wired as you said, and code. All works fine, however, no display lighting up. How do
i light up the display and set some text?
I Am trying my hardest to understand OLEDS and U8G2 but i would be so very happy if someone
could provide some " Hello World " code for the following OLED:
Thankyou so dearly.
"HelloWorld" example is included with u8g2 (see the examples menu of the Arduino IDE). Just uncomment the U8G2_SSD1306_128X32_UNIVISION_1_HW_I2C for your device.
Well, thank you for your help, your a legend, i think i have grasped U8G2 pretty well but i still have a fair bit to learn and will probably have many questions for you guys until i master it myself. As for the above four digit OLED i think it is defunct thats what you get for $4 lol. I've put all the right wiring and code and still nothing.!.
Next ill try a new display and ill probably have to ask you how to set it up if you guys don't mind.!.
Cheers. ( And stay safe floridians ).