Skip to content

Instantly share code, notes, and snippets.

@bmoren
Created September 25, 2014 03:05
Show Gist options
  • Save bmoren/f08cb79c1991c16ea06f to your computer and use it in GitHub Desktop.
Save bmoren/f08cb79c1991c16ea06f to your computer and use it in GitHub Desktop.
void setup() {
size(320,320);
frameRate(30);
}
void draw() {
// set background to black
background(0);
// get my current time values
int mySecond = second(); // Values from 0 - 59
int myMinute = minute(); // Values from 0 - 59
int myHour = hour(); // Values from 0 - 23
// set drawing color to white
stroke(255);
// draw the seconds line
line(mySecond, 0, mySecond, 33);
// draw the minutes line
line(myMinute, 33, myMinute, 66);
// draw the hours line
line(myHour, 66, myHour, 100);
// useful functions
// lerp
// lerpColor
// map
int value = floor(random(0,100));
println(value);
println(floor(map(value,0,100,1,10)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment