Blockly to Communicate with firmata

541 views
Skip to first unread message

sathiya priya srinivasa raghavan

unread,
May 26, 2015, 1:51:58 AM5/26/15
to blo...@googlegroups.com
Hi,
I am working on Robotics Projects using Arduino and we use Standard Firmata for communicating...
Can you please tell me whether Blockly can communicate using Standard Firmata like SCRATCH..

Thank you.
Sathiya Priya

Carlos Pereira

unread,
May 26, 2015, 6:39:37 PM5/26/15
to blo...@googlegroups.com
Blockly, on its own, is library to build visual programming editors. Out of the box it supports source code generators for Python, JavaScript and Dart (looks like PHP could added soon). But it can be expanded to generate other languages.

Blocklyduino is a fork from Blockly by Gasolin to generate Arduino code (I have myself pursued a similar fork with Ardublockly). So if you are trying to generate Arduino code for the Firmata protocol either of those could be updated to generate code for the Arduino Firmata library. If you are trying to generate code to send Firmata messages to an Arduino, then Blockly could be updated to use any of the multiple Firmata libraries in Python, Javascript (these are usually for Node), or Dart. However you will have to device a method to retrieve and execute the code generated by Blockly, with multiple options depending on your language of choice. 

Kind Regards,
Carlos

harish A

unread,
May 27, 2015, 1:07:50 AM5/27/15
to blo...@googlegroups.com
Even if i edit blockly such that it works with firmata, Is it possible to make bluetooth serial communication between blockly and arduino. If so pls let me kno how?

Thanks in advance.

Carlos Pereira

unread,
May 27, 2015, 4:14:30 PM5/27/15
to blo...@googlegroups.com
That will depend on the library you are planning to use with Blockly, and what you build around Blockly. On its own Blockly just runs in a browser, you can think of it as being a textfield in an html file, you can write your code on it and use javascript to retrieve it, how you compile it, execute it, or interface with the computer running it depends on you.

There are quite a few projects that use Blockly to generate code and then compile it or execute it one way or another (there is list in https://developers.google.com/blockly/about/examples , but there are many more). Blockly itself comes with examples, one of which has a JS interpreter that executes in the browser (https://blockly-demo.appspot.com/static/demos/index.html).

So, if you can build an application that can execute code written using a firmata library and communicate with an Arduino using bluetooth (generally this is just sending data through a serial port, if the arduino has the bluetooth module connected to the UART RX and TX pins), then you can use Blockly to generate that code.

There might be projects out there with something similar to what you need (not necessarily using Blockly), that you could use to leverage a lot of the work to implement this, but I am not very aware of firmata projects. Maybe somebody else could suggest a similar kind of project?
 

Kind regards,
Carlos
Reply all
Reply to author
Forward
0 new messages