Round LCD clock (Waveshare)

The Waveshare ESP32-S3 round LCD: a watch face with a sweeping second hand.

Round LCD clock (Waveshare) in Argynix Lab

The code

sketch.inoC++
// Waveshare's ESP32-S3 1.28-inch round LCD: a GC9A01 on the default SPI, its pins named by
// the board's Arduino variant (LCD_DC, LCD_RST, LCD_BACKLIGHT). A watch face from millis().
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_GC9A01A.h>

Adafruit_GC9A01A tft(SS, LCD_DC, LCD_RST);
const int C = 120;
float last = -1;

void hand(float turn, int length, uint16_t colour) {
  float a = turn * TWO_PI - HALF_PI;
  tft.drawLine(C, C, C + cos(a) * length, C + sin(a) * length, colour);
}

void setup() {
  pinMode(LCD_BACKLIGHT, OUTPUT);
  digitalWrite(LCD_BACKLIGHT, HIGH);
  tft.begin();
  tft.fillScreen(GC9A01A_BLACK);
  tft.drawCircle(C, C, 118, GC9A01A_DARKGREY);
  for (int i = 0; i < 12; i++) {
    float a = i * TWO_PI / 12;
    tft.fillCircle(C + cos(a) * 104, C + sin(a) * 104, i % 3 ? 2 : 4, GC9A01A_WHITE);
  }
}

void loop() {
  float s = (millis() % 60000) / 60000.0;
  if (last >= 0) hand(last, 90, GC9A01A_BLACK);
  hand(s, 90, GC9A01A_RED);
  tft.fillCircle(C, C, 5, GC9A01A_WHITE);
  last = s;
  delay(100);
}