skip navigation

A little digital clock I made in Processing

This is a little digital clock I made in Processing a while back. I’ve just come across it by chance and decided I actually quite liked it.

And here’s the tiny little script for those of you who are interested:


void setup(){
textFont(loadFont("a.vlw"));
}
void draw(){
background(0);
int m=minute(),s=second(),h=hour();
float hy=(height+20)/60*m;
float my=(height+20)/60*s;
float sy=map(millis()%1000,0,1000,0,120);
text(h,9,hy);
text(m,40,my);
text(s,70,sy);
}

Tags: , ,

Leave a Comment