Skip to content

[request] I2C OLED display example #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lboue opened this issue Nov 3, 2024 · 2 comments
Closed

[request] I2C OLED display example #96

lboue opened this issue Nov 3, 2024 · 2 comments
Labels
featurerequest Feature request

Comments

@lboue
Copy link

lboue commented Nov 3, 2024

Summary

Hello,

I would use I2C OLED display example to print pairing QRcode. Could you add an example?

Regards

@lboue lboue added the featurerequest Feature request label Nov 3, 2024
@lboue
Copy link
Author

lboue commented Nov 15, 2024

I managed to run a demo code with an I2C OLED screen : SSD1306_128X64:

#include <Arduino.h>
#include <U8g2lib.h>
#include <Wire.h>
#include "smiley_face.h" 

// QWIIC connector
#define SDA 20
#define SCL 19

// SW_I2C	Software emulated I2C/TWI
U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, SCL, SDA, U8X8_PIN_NONE);

int xx = 20; 
int yy = 10; 

void setup() {
    Serial.begin(115200); // Initialize the serial communication at 115200 baud rate
    u8g2.begin();
}

void loop() {
    smeil_display();
    delay(500); 
}

void smeil_display() {
    const unsigned char* smileImages[] = {
        semil1, semil2, semil3, semil4, semil5,
        semil6, semil7, semil8, semil9, semil10,
        semil11, semil12, semil13, semil14, semil15,
        semil16, semil17, semil18, semil19, semil20,
        semil21, semil22, semil23, semil24, semil25,
        semil26, semil27
    };

    int delays[] = {
        40, 50, 40, 40, 40,
        40, 40, 50, 40, 40,
        40, 40, 40, 50, 40,
        40, 50, 40, 40, 50,
        40, 50, 40, 40, 50,
        50, 50, 40, 50
    };

    for (int i = 0; i < sizeof(smileImages) / sizeof(smileImages[0]); i++) {
        u8g2.firstPage();
        do {
            u8g2.drawXBMP(xx, yy, 48, 48, smileImages[i]); 
        } while (u8g2.nextPage());
        delay(delays[i]); 
    }
}

@leonardocavagnis
Copy link
Contributor

Hi @lboue,
For requests like this, we recommend using the Arduino Forum, which is better suited for community discussions and support. The Issues section is primarily intended for reporting bugs or requesting new features related to the core functionalities.
There is a dedicated section for the Arduino Nano Matter board here.
Feel free to post your question there, and the community will be happy to assist you.

@lboue lboue closed this as completed Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
featurerequest Feature request
Projects
None yet
Development

No branches or pull requests

2 participants