10 Second Countdown with an OLED and uChip

Description: An OLED 64×32 connected to a uChip displays a 10 second countdown on a repeated loop.

Countdown with uChip

Supplies:

1 –  Breadboard 400 Points
1 – uChip
1 – OLED Display 0.49″ 64×32 SSD1306   >> Link <<

Arduino Code:

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

U8G2_SSD1306_64X32_1F_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);

void setup() {
  
  u8g2.begin();

}

void loop() {

  u8g2.clearBuffer(); // clear the internal memory
  u8g2.setFont(u8g2_font_inb24_mr); // choose a font
  u8g2.setCursor(10, 30);
  u8g2.print(10); // write something to the internal memory
  u8g2.sendBuffer(); // transfer internal memory to the display
  delay(1000);

  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_inb24_mr);
  u8g2.setCursor(20, 30);
  u8g2.print(9);
  u8g2.sendBuffer();
  delay(1000);

  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_inb24_mr);
  u8g2.setCursor(20, 30);
  u8g2.print(8);
  u8g2.sendBuffer();
  delay(1000);

  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_inb24_mr);
  u8g2.setCursor(20, 30);
  u8g2.print(7);
  u8g2.sendBuffer();
  delay(1000);

  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_inb24_mr);
  u8g2.setCursor(20, 30);
  u8g2.print(6);
  u8g2.sendBuffer();
  delay(1000);

  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_inb24_mr);
  u8g2.setCursor(20, 30);
  u8g2.print(5);
  u8g2.sendBuffer();
  delay(1000);

  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_inb24_mr);
  u8g2.setCursor(20, 30);
  u8g2.print(4);
  u8g2.sendBuffer();
  delay(1000);

  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_inb24_mr);
  u8g2.setCursor(20, 30);
  u8g2.print(3);
  u8g2.sendBuffer();
  delay(1000);

  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_inb24_mr);
  u8g2.setCursor(20, 30);
  u8g2.print(2);
  u8g2.sendBuffer();
  delay(1000);

  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_inb24_mr);
  u8g2.setCursor(20, 30);
  u8g2.print(1);
  u8g2.sendBuffer();
  delay(1000);

  u8g2.clearBuffer(); // clear the internal memory
  u8g2.sendBuffer(); // transfer internal memory to the display
  delay(1000);

}

Leave a Comment

30 − = 21