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
0207d715
authored
Dec 15, 2017
by
Sebastián Collado Montañez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
servo test
parent
bbbb810c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
webserver.js
webserver.js
View file @
0207d715
...
...
@@ -21,7 +21,19 @@ var motor = new Gpio(13, {mode: Gpio.OUTPUT});
var
pulseWidth
=
1850
;
var
increment
=
-
10
;
var
test
=
setInterval
(
function
()
{
for
(
var
i
=
0
;
i
<
90
;
i
++
){
setTimeout
(
function
(){
pulseWidth
+=
-
10
;
},
100
);
if
(
pulseWidth
>
950
){
console
.
log
(
"Fuera de rango en apertura"
);
break
;
}
}
/*var test = setInterval(function () {
motor.servoWrite(pulseWidth);
pulseWidth += increment;
...
...
@@ -32,7 +44,7 @@ var test = setInterval(function () {
increment = 10;
}
},
100
);
}, 100);
*/
// Clean LEDs
//RED.pwmWrite(dutyCycle);
...
...
@@ -45,7 +57,7 @@ var test = setInterval(function () {
*/
app
.
use
(
'/public'
,
express
.
static
(
__dirname
+
'/public'
));
app
.
get
(
'/'
,
function
(
req
,
res
)
{
res
.
sendFile
(
__dirname
+
'/views/index.html'
);
res
.
sendFile
(
__dirname
+
'/
public/
views/index.html'
);
});
server
.
listen
(
'8080'
);
...
...
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