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
806fc5c1
authored
Dec 17, 2017
by
Sebastián Collado Montañez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
problemas de sincronismo
parent
b7af6777
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
webserver.js
webserver.js
View file @
806fc5c1
...
...
@@ -56,9 +56,9 @@ trigger.digitalWrite(0);
}
});
}());
//
Trigger a distance measurement once per second
//
Lanza la medicion de distancia una vez cada segundo
setInterval
(
function
()
{
trigger
.
trigger
(
10
,
1
);
//
Set trigger high for 10 microsecond
s
trigger
.
trigger
(
10
,
1
);
//
Lanza una señal HIGHT durante 10m
s
},
1000
);
// Abrir puerta
...
...
@@ -108,11 +108,6 @@ function cerrarPuerta(){
},
100
);
}
// Clean LEDs
//RED.pwmWrite(dutyCycle);
//GREEN.pwmWrite(dutyCycle);
//BLUE.pwmWrite(dutyCycle);
/*
WEB SERVER
...
...
@@ -150,6 +145,12 @@ io.sockets.on('connection', function (socket) { // WebSocket Connection
if
(
estadoPuerta
==
1
&&
ordenRecibida
==
0
)
{
cerrarPuerta
();
console
.
log
(
"Cerrando puerta"
);
if
(
obstaculo
){
ordenRecibida
=
1
;
socket
.
broadcast
.
emit
(
"actualizarEstado"
,
Number
(
estadoPuerta
));
socket
.
emit
(
"actualizarEstado"
,
Number
(
estadoPuerta
));
}
}
if
(
estadoPuerta
==
1
&&
ordenRecibida
==
1
)
console
.
log
(
"La puerta ya se encuentra abierta"
);
...
...
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