Skip to content

Instantly share code, notes, and snippets.

@ianjorgensen
Created August 1, 2017 23:07
Show Gist options
  • Save ianjorgensen/a3636cc4ee9c66eb817d1eb19d5cdab7 to your computer and use it in GitHub Desktop.
Save ianjorgensen/a3636cc4ee9c66eb817d1eb19d5cdab7 to your computer and use it in GitHub Desktop.
clean read while writting
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