Skip to content
Snippets Groups Projects
Commit aca03b15 authored by jiajunw6's avatar jiajunw6
Browse files

Update index.js to improve resolution

parent 109d68e4
No related branches found
No related tags found
No related merge requests found
......@@ -23,12 +23,16 @@ function send_command(input) {
client.destroy();
});
} else if(input=='photo') {
window.photodata='';
client.on('data', (output) => {
console.log(output.toString());
console.log(output.toString().length);
document.getElementById("photo").src='data:image/png;base64,'+(output.toString());
client.end();
client.destroy();
photodata=photodata+output.toString().replace(/[\n\r\s\*]/g,'');
if(output.toString().indexOf('*')!=-1) {
document.getElementById("photo").src='data:image/png;base64,'+window.photodata;
client.end();
client.destroy();
}
});
} else {
client.on('data', (output) => {
......@@ -89,8 +93,8 @@ function resetKey(e) {
setInterval(function(){
send_command('status');
}, 100);
}, 500);
setInterval(function(){
send_command('photo');
}, 1200);
}, 800);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment