Skip to content

Show a time countdown on OLED with option to exit countdown #86

Closed Answered by Spirik
acabrera2012 asked this question in Q&A
Discussion options

You must be logged in to vote

Looks good to me! U8g2 do loop looks fine.

If by text sizing you mean larger font for countdown, U8g2 got you covered. You can use any of the supported fonts shipped with U8g2 library (assuming it will fit into memory). Just call u8g2.setFont(); with font name of your choice before printing to the screen. For example, modified version of do loop can look like this:

u8g2.firstPage();
do {
  if (currentCountdownSeconds <= 0) {
    //u8g2.clear();
    u8g2.setCursor(33, 5);
    u8g2.print("TRANSMITTING...");
    u8g2.setCursor(14, 50);
    u8g2.print("Push knob to exit");
    Serial.println(F("Countdown complete!"));
    turnOn(level, duration);
    delay(2000);
    getRandomMinute();       …

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@acabrera2012
Comment options

@acabrera2012
Comment options

@acabrera2012
Comment options

@Spirik
Comment options

Answer selected by acabrera2012
@acabrera2012
Comment options

@Spirik
Comment options

@acabrera2012
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants