Fixes #55
This commit is contained in:
@@ -18,7 +18,7 @@ npm start
|
|||||||
|
|
||||||
## UDP Controls
|
## UDP Controls
|
||||||
|
|
||||||
Dotgrid can be controlled by UDP via the port `49160`. It expects messages up to 6 characters.
|
Dotgrid can be controlled by UDP via the port `49161`. It expects messages up to 6 characters.
|
||||||
|
|
||||||
- **layer** `0/1/2`
|
- **layer** `0/1/2`
|
||||||
- **type** `l/c/r/z` (`l`:line, `c`:clock-wise arc, `r`: cc-wise arc, `z`: close, `.`:clear, `*`: draw)
|
- **type** `l/c/r/z` (`l`:line, `c`:clock-wise arc, `r`: cc-wise arc, `z`: close, `.`:clear, `*`: draw)
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ function Listener (dotgrid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function draw () {
|
function draw () {
|
||||||
dotgrid.renderer.update()
|
dotgrid.renderer.update(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
function parse (msg) {
|
function parse (msg) {
|
||||||
if (msg === '') {
|
if (msg === '' || msg === '*') {
|
||||||
return draw()
|
return draw()
|
||||||
}
|
}
|
||||||
if (['0', '1', '2'].indexOf(msg) > -1) {
|
if (['0', '1', '2'].indexOf(msg) > -1) {
|
||||||
@@ -65,5 +65,5 @@ function Listener (dotgrid) {
|
|||||||
server.close()
|
server.close()
|
||||||
})
|
})
|
||||||
|
|
||||||
this.server.bind(49160)
|
this.server.bind(49161)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user