I have developing alljoyn on Arduino YUN using Alljoyn.js. I want to use UART function on YUN, but I don`t know what to do. They introduce page that how can use UART function on YUN like below.
I have conntected RX(0), TX(1) pin to Arduino YUN. But my YUN still not working UART function.
Please help me. Thank you.
IO.uart(IO.pin#1, IO.pin#2, baud)- Create a new uart peripheral object
1: The pin number of the TX pin on the AllJoyn JS device.
2: The pin number of the RX pin on the AllJony JS device.
baud: The baud rate for the UART peripheral
uart() has 2 functions: write() and read(). The write() function will support many data types: Booleans, numbers, strings, buffers, and arrays of any of the previous types. The read() function takes a length parameter and returns a Duktape Buffer.
var u = IO.uart(IO.pin4, IO.pin5, 115200);
u.write(["this", "is", "an", "array", "of", "strings"]);
/Read 10 bytes/
var r = IO.read(10);