-
• #2
Hi Phil,
Yes - it's because the console (the thing that would have been on the left-hand side of the Web IDE) automatically moves to Bluetooth (Serial1) when the board isn't connected to USB (so you can actually program it through bluetooth).
All you need to do is put the code
USB.setConsole()
inonInit()
. That'll move the console away from Serial and on to USB even though it isn't connected.With the console put on Bluetooth you can actually send
JavaScript commands straight over though, for instance"s.move(5)\n"
-
• #3
Oh I love the idea of sending commands as script to execute :)
Yep that got it working.
Many thanks!
Hi
I have a little test script running fone when connected to USB:
If I send messages to the bluetooth connection from an app on my phone, first a string of a float (e.g. '0.1') then post another BT message containing just a comma ',' the servo moves.
I can disconnect from the WebIDE. It still works.
However! If I unplug the USB, I get a BT message back from the board to my phone:
'Console Moved from USB'
Now it fails to work. I send it the float, it echos it back. I send the comma, its sends error:
"Uncaught SyntaxError: Got ',' expected EOF at line 1 col 1
,
^"
Any help appreciated. :)
Phil