A space to tinker with things. Microcontroller, arduino, processing, gadget, web, etc.
Tinkering Things
May 16, 2009
/**
* A fullscreen digital clock with date in processing. It uses a library from
* http://www.superduper.org/processing/fullscreen_api/
* You have to create your own font from the menu
* Tools > Create Font… before running.
*
* http://xperimnt.tumblr.com
*/

import fullscreen.*; 
FullScreen fs;
int xpos = screen.width / 2;
int ypos = screen.height / 2;

void setup(){
  size(screen.width, screen.height);
  frameRate(60);
  fs = new FullScreen(this); 
  fs.enter(); 
  textAlign(CENTER);
}

void draw(){
  background(#333333);
  PFont myFont = loadFont(“OCRAbyBT-Regular-240.vlw”);
  textFont(myFont, 240);
  String theTime = nf(hour(), 2) + “:” + nf(minute(), 2) + “:”+ nf(second(), 2);
  fill(#ffffff, 63);
  int pad = 25;
  text(theTime, xpos, ypos+pad);
  PFont myCal = loadFont(“Calibri-24.vlw”);
  textFont(myCal, 24);
  fill(#ffffff, 63);
  String dText = nf(day(), 2); // Values from 01 - 31
  String mText = nf(month(), 2); // Values from 01 - 12
  String yText = nf(year(), 4); // 2003, 2004, 2005, etc.
  text(dText+”.”+mText+”.”+yText, xpos, ypos+120);
}

/**
* A fullscreen digital clock with date in processing. It uses a library from
* http://www.superduper.org/processing/fullscreen_api/
* You have to create your own font from the menu
* Tools > Create Font… before running.
*
* http://xperimnt.tumblr.com
*/

import fullscreen.*;
FullScreen fs;
int xpos = screen.width / 2;
int ypos = screen.height / 2;

void setup(){
size(screen.width, screen.height);
frameRate(60);
fs = new FullScreen(this);
fs.enter();

textAlign(CENTER);
}

void draw(){
background(#333333);

PFont myFont = loadFont(“OCRAbyBT-Regular-240.vlw”);
textFont(myFont, 240);
String theTime = nf(hour(), 2) + “:” + nf(minute(), 2) + “:”+ nf(second(), 2);
fill(#ffffff, 63);
int pad = 25;
text(theTime, xpos, ypos+pad);

PFont myCal = loadFont(“Calibri-24.vlw”);
textFont(myCal, 24);
fill(#ffffff, 63);
String dText = nf(day(), 2); // Values from 01 - 31
String mText = nf(month(), 2); // Values from 01 - 12
String yText = nf(year(), 4); // 2003, 2004, 2005, etc.
text(dText+”.”+mText+”.”+yText, xpos, ypos+120);
}