This works great for sending values to the board through USB, or with Bluetooth (for the Metabot).
There is however an issue when receiving data:
score reports that the data is received in the message window:
Debug: “1\n” (serial_protocol:49)
similarly as when data is sent out witch shows on the message window as follows:
Debug: “1\n” (serial_protocol:90)
The problem is to allocate the value to an address in the Serial Device tree.
The “function onMessage(message)” does not seem to return anything.
I tried adding a “console.log(message)” inside but it had no effect on the message window.
here is the little qml code:
import QtQuick 2.0
import Ossia 1.0 as Ossia
QtObject {
function openListening(address) {}
function closeListening(address) {}
function onMessage(message) {
console.log(message);
return [{address: recieve, value: message}];
}
function createTree() {
return [ {
name: “led”,
type: Ossia.Type.Int,
request: “$val”,
access: Ossia.Access.Set
},
{
name: “recieve”,
type: Ossia.Type.Int,
access: Ossia.Access.Get
} ];
}
}
The problem could be that the function “onMessage()” dosen’t recognise “\n” as the end of a message and still waits. Just a wild gess.