Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Sebastián Collado Montañez
/
proyecto-micro
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2a1b78df
authored
Dec 14, 2017
by
Sebastián Collado Montañez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
puerta abriendo y cerrando
parent
978af40f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
webserver.js
webserver.js
View file @
2a1b78df
...
@@ -12,25 +12,24 @@ var RED = new Gpio(4, {mode: Gpio.OUTPUT});
...
@@ -12,25 +12,24 @@ var RED = new Gpio(4, {mode: Gpio.OUTPUT});
var
GREEN
=
new
Gpio
(
17
,
{
mode
:
Gpio
.
OUTPUT
});
var
GREEN
=
new
Gpio
(
17
,
{
mode
:
Gpio
.
OUTPUT
});
var
BLUE
=
new
Gpio
(
27
,
{
mode
:
Gpio
.
OUTPUT
});
var
BLUE
=
new
Gpio
(
27
,
{
mode
:
Gpio
.
OUTPUT
});
//apertura maxima 550
//cierre maximo 1850
//cierre maximo 1850
//apertura maxima 550
var
motor
=
new
Gpio
(
13
,
{
mode
:
Gpio
.
OUTPUT
}),
var
motor
=
new
Gpio
(
13
,
{
mode
:
Gpio
.
OUTPUT
}),
pulseWidth
=
1850
,
pulseWidth
=
1850
,
increment
=
100
;
increment
=
-
100
;
/*
var test = setInterval(function () {
var
test
=
setInterval
(
function
()
{
motor
.
servoWrite
(
pulseWidth
);
motor
.
servoWrite
(
pulseWidth
);
pulseWidth
+=
increment
;
pulseWidth
+=
increment
;
if (pulseWidth >= 2000) {
if
(
pulseWidth
>=
1850
)
{
increment
=
-
100
;
increment
=
-
100
;
} else if (pulseWidth <=
100
0) {
}
else
if
(
pulseWidth
<=
55
0
)
{
increment
=
100
;
increment
=
100
;
}
}
}, 1000);*/
motor
.
servoWrite
(
pulseWidth
);
},
1000
);
// Clean LEDs
// Clean LEDs
//RED.pwmWrite(dutyCycle);
//RED.pwmWrite(dutyCycle);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment