Initial commit of work directory
This commit is contained in:
27
robot/ComSender.js
Executable file
27
robot/ComSender.js
Executable file
@@ -0,0 +1,27 @@
|
||||
const fs = require('fs');
|
||||
|
||||
module.exports = class ComSender{
|
||||
|
||||
|
||||
constructor(){
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
moveTo(mOld, mNew){
|
||||
|
||||
|
||||
try {
|
||||
const fd = fs.openSync('/dev/tty0', 'w'); // may require root
|
||||
fs.writeSync(fd, 'Hello console from Node.js!\n');
|
||||
fs.closeSync(fd);
|
||||
console.log('Wrote to /dev/tty0');
|
||||
} catch (err) {
|
||||
console.error('Failed to write to /dev/tty0:', err);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user