Interfacing PIC16F877A with SSD1306 OLED display | Simulation

Поділитися
Вставка
  • Опубліковано 25 жов 2024

КОМЕНТАРІ • 3

  • @ElectronicsDeveloper
    @ElectronicsDeveloper  3 роки тому +4

    Source code :
    #define SSD1306_RST PIN_D4
    #include
    #fuses HS,NOWDT,NOPROTECT,NOLVP
    #use delay(clock = 20MHz)
    #use I2C(MASTER, I2C1, FAST = 400000, stream = SSD1306_STREAM) // Initialize I2C

    // Include SSD1306 OLED driver source code
    #include

    int8 i = 0;

    void main() {

    delay_ms(500);

    // Initialize the SSD1306 OLED with an I2C addr = 0x7A (default address)
    SSD1306_Init(SSD1306_SWITCHCAPVCC, SSD1306_I2C_ADDRESS);

    // clear the display
    SSD1306_ClearDisplay();

    SSD1306_GotoXY(1, 1);
    SSD1306_PutC("Interfacing PIC16F877A with SSD1306 OLED display");
    delay_ms(5000);

    SSD1306_ClearDisplay();

    SSD1306_GotoXY(6, 2);
    SSD1306_PutC("Hello world!");
    delay_ms(2000);

    SSD1306_StartScrollRight(1, 1);
    delay_ms(3000);
    SSD1306_StopScroll();

    SSD1306_StartScrollLeft(1, 1);
    delay_ms(3000);
    SSD1306_StopScroll();

    SSD1306_StartScrollDiagRight(1, 1);
    delay_ms(3000);
    SSD1306_StopScroll();

    SSD1306_StartScrollDiagLeft(1, 1);
    delay_ms(3000);
    SSD1306_StopScroll();

    delay_ms(3000);
    SSD1306_ClearDisplay();

    SSD1306_GotoXY(6, 2);
    SSD1306_PutC("Hello world!");
    delay_ms(2000);

    while(TRUE) {
    SSD1306_GotoXY(10, 5);
    printf(SSD1306_PutC, "%03u", i++);
    delay_ms(500);
    }
    }

  • @hoanghung2807
    @hoanghung2807 5 місяців тому +1

    How do you make with oled ssd1306 i2c 4 pin??

    • @ElectronicsDeveloper
      @ElectronicsDeveloper  5 місяців тому

      Here we used the bus connections, if you need a design to understand how we created a bus then ping us on email