Created
August 1, 2017 23:07
-
-
Save ianjorgensen/a3636cc4ee9c66eb817d1eb19d5cdab7 to your computer and use it in GitHub Desktop.
clean read while writting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var read = require("read") | |
setInterval(function () { | |
var message = 'The time is: ' + new Date() | |
console.log(message) | |
}, 1000) | |
var readSPICommand = function() { | |
read({ | |
prompt: 'WRITE SPI CMD:', | |
output: process.stdin | |
}, | |
function(err, value) { | |
var message = 'CMD: ' + value | |
0x | |
console.log(message) | |
readSPICommand() | |
} | |
) | |
}; | |
readSPICommand() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment