I tried using String.fromCharCode(data); but this only works for values up to 127 (0x7F) since that is all ASCII goes to. This must not support extended ASCII?
<html>
<body>
Uart Byte:<br>
<input type="number" name="value" id='value'/>
<button onclick="uartWr()">SEND</button>
</body>
<head>
<script src="/bonescript.js"></script>
<script>
function uartWr() {
var b = require('bonescript');
var port = '/dev/ttyO2'; // set UART port
var data = document.getElementById('value').value;
// set baud rate and buffer size
var options = {
baudrate: 9600
};
b.serialWrite(port, data );
}
</script>
</head>
</html>