UNPKG
raspio
Version:
latest (3.0.3)
3.0.3
3.0.2
3.0.1
3.0.0
2.1.1
2.1.0
2.0.1
2.0.0
1.1.0
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
A raspberry advanced GPIO library for node.js
github.com/taoyuan/raspio
taoyuan/raspio
raspio
/
lib
/
effects
/
breath.js
17 lines
(12 loc)
•
243 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"use strict"
;
module
.
exports
=
function
(
total
) {
var
direction =
1
;
return
function
(
step
) {
if
(step <=
0
) { direction =
1
}
else
if
(step >= total -
1
) { direction = -
1
; }
return
step + direction; } };