I recently received OLED 128x32 i2C SSD1306, connected it and it isnt working with code i found.
Then i figured out it may be the code, tryed te second one same thing, figured out each OLED has its own address so i ran a i2C Scanner from Arduino playground ti find it stuck on "Scanning..."
Everything is wired correct, code is running on correct port, and selected in exaples the right 128x32 i2c code.
Also for some reason i got SCK instead of SCL like many other i saw people use.
Any ideas on how do get it unstuck from only "Scanning..." and get the address and then get it to work?
#include <Arduino.h>
#include <U8g2lib.h>
#include <SPI.h>
#include <Wire.h>
U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0);
void setup(void) {
u8g2.begin();
}
void loop(void) {
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_logisoso28_tr); // choose a suitable font at https://github.com/olikraus/u8g2/wiki/fntlistall
u8g2.drawStr(8,29,"MYBOTIC"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(3000);
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_logisoso28_tr); // choose a suitable font at https://github.com/olikraus/u8g2/wiki/fntlistall
u8g2.drawStr(31,24,"your"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(800);
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_logisoso28_tr); // choose a suitable font at https://github.com/olikraus/u8g2/wiki/fntlistall
u8g2.drawStr(10,29,"robotic"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(800);
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_logisoso28_tr); // choose a suitable font at https://github.com/olikraus/u8g2/wiki/fntlistall
u8g2.drawStr(4,29,"solution"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(2000);
}
I2C modules to be connected to A4 (SDA) and A5 (SCL) as i see you are connecting to D2 and D3 which is wrong. Don't connect LED directly to Arduino ports, this will destroy the IC port over the time.