Yes that worked thanks. On Wednesday, November 19, 2014 3:26:23 PM UTC-8, John Mladenik wrote: > > I need to be able to send raw data out of the serial port using Bonescript > command b.serialWrite. I set up an HTML Bonescript to send data and then > looked on the logic analyzer to see what bit pattern is sent out. The > pattern is always the ASCII value of the character whether the variable is > a text or number. > > Does anyone know how to pass to b.serialWrite a value so that the UART > outputs that value? > > so I want to have > > var port = '/dev/ttyO2'; // set UART port > var data = 0x55 ; > b.serialWrite(port, data ); > > and for the bit pattern coming out of the UART to be 01010101 > > 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? > > here is my html/javascript to test this functionality > > <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> > > >
-- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.