UNPKG
wolkd
Version:
latest (0.5.2)
0.5.2
0.5.1
0.5.0
Server and user interface to control WS2801 RGB LED strips via SPI
wolk.bike
bertspaan/wolkd
wolkd
/
patterns
/
functions
/
sine.js
12 lines
(11 loc)
•
242 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
module
.
exports
= {
title
:
'Sine'
,
length
:
4
,
type
:
'continuous'
,
getPixel
:
function
(
beat, t
) {
var
a = t %
100
/
100
*
Math
.
PI
*
2
;
var
v = (
Math
.
cos
(a) +
1
) /
2
;
var
g =
Math
.
round
(v *
255
);
return
[g, g, g]; } };