Skip to content

Commit

Permalink
reference: Add time (#202)
Browse files Browse the repository at this point in the history
* reference: Add day1

Signed-off-by: Ce Gao <[email protected]>

* reference: Add hour

Signed-off-by: Ce Gao <[email protected]>

* reference: Add millis

Signed-off-by: Ce Gao <[email protected]>

* reference: Add time

Signed-off-by: Ce Gao <[email protected]>
  • Loading branch information
gaocegege authored Aug 8, 2017
1 parent 41050bf commit 262c305
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/reference/day/day1/day1.rpde
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
d = day() # Values from 1 - 31
m = month() # Values from 1 - 12
y = year() # 2003, 2004, 2005, etc.

text(toString(d), 10, 28)
text(toString(m), 10, 56)
text(toString(y), 10, 84)
9 changes: 9 additions & 0 deletions examples/reference/hour/hour1/hour1.rpde
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
draw <- function() {
background(204)
s = second() # Values from 0 - 59
m = minute() # Values from 0 - 59
h = hour() # Values from 0 - 23
line(s, 0, s, 33)
line(m, 33, m, 66)
line(h, 66, h, 100)
}
6 changes: 6 additions & 0 deletions examples/reference/millis/millis1/millis1.rpde
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
draw <- function() {
m = millis()
noStroke()
fill(m%%255)
rect(25, 25, 50, 50)
}
9 changes: 9 additions & 0 deletions examples/reference/minute/minute1/minute1.rpde
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
draw <- function() {
background(204)
s = second() # Values from 0 - 59
m = minute() # Values from 0 - 59
h = hour() # Values from 0 - 23
line(s, 0, s, 33)
line(m, 33, m, 66)
line(h, 66, h, 100)
}
7 changes: 7 additions & 0 deletions examples/reference/month/month1/month1.rpde
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
d = day() # Values from 1 - 31
m = month() # Values from 1 - 12
y = year() # 2003, 2004, 2005, etc.

text(toString(d), 10, 28)
text(toString(m), 10, 56)
text(toString(y), 10, 84)
9 changes: 9 additions & 0 deletions examples/reference/second/second1/second1.rpde
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
draw <- function() {
background(204)
s = second() # Values from 0 - 59
m = minute() # Values from 0 - 59
h = hour() # Values from 0 - 23
line(s, 0, s, 33)
line(m, 33, m, 66)
line(h, 66, h, 100)
}
7 changes: 7 additions & 0 deletions examples/reference/year/year1/year1.rpde
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
d = day() # Values from 1 - 31
m = month() # Values from 1 - 12
y = year() # 2003, 2004, 2005, etc.

text(toString(d), 10, 28)
text(toString(m), 10, 56)
text(toString(y), 10, 84)

0 comments on commit 262c305

Please sign in to comment.