ArduBlock on Hack a Day
Dec 1st, 2011 by david

It’s pretty awesome to see ArduBlock mentioned on Hack a Day.


Untitled

Install ArduBlock into Arduino IDE
Oct 25th, 2011 by david

1.Download ardublock-all.jar ArduBlock

2. In Arduino IDE, open menu “Arduino” -> “Preferences”

3. Find “Sketchbook location:”

  • In Mac, it’s by default “Documents/Arduino” under user’s home directory
  • In Linux, it’s by default “sketchbook” under user’s home directory
  • In Windows, it’s by default “Documents\Arduino” under user’s home directory

4. Copy ardublock-all.jar to tools/ArduBlockTool/tool/ardublock-all.jar under “Sketchbook location”,Assume the user is “abu,”

  • In Mac, /Users/abu/Documents/Arduino/tools/ArduBlockTool/tool/ardublock-all.jar
  • In Linux, /home/abu/sketchbook/tools/ArduBlockTool/tool/ardublock-all.jar
  • In Windows, C:\Users\abu\Documents\Arduino

5. Start the Arduino IDE and find ArduBlock under the Tool menu

Untitled

Integrate with Arduino IDE
Sep 14th, 2011 by david

Finally, after months of work, we have a version integrated with Arduino IDE! ;) Download it here and put it under your ‘tools’ directory at “tools/ArduBlockTool/tool/ardublock-all.jar”.

Untitled

ArduBlock Drawers
Aug 22nd, 2011 by david

Example of a ArduBlock Program

Programs

The drawers of ArduBlock are divided into 6 different categories.

Control

Control blocks are for program flow control

Controls

Numbers, Constants and Variables

These blocks provide access to computational data

Controls

Operators

These blocks provides operators for logical and mathematical computation

Operators

Utilities

These blocks provide access to utilities functions provided by Arduino platform

Utilities

Bricks

These blocks provide more intuitive access to electronic bricks system.

Bricks

Pin

This drawer probably needs a better name. The blocks here provide I/O access to Arduino Pins

Pins

Pin Blocks Design
Feb 21st, 2011 by david

Finally got a few hours to test out a few Pin block design ideas for the ArduBlock. The goal of the design is to enable users to naturally express their intention into the blocks. Most of the Arduino programs are reactive to the INPUT value on the pin and this naturally leads to an event driven design on the PIN block.

Handling Digital Input and Output

The block below basically represent the “Hello World” of Arduino Programming mapping to the code fragments


  if (digitalRead(1) == HIGH) {
    digitalWrite(2, HIGH);
  }

Untitled

Multiple events on the same pin should be support by defining multiple events on the same pin. It seems that a good visual grouping of the same pin would be a good thing and improve readability of the program.

Untitled

The OpenBlocks come with a pretty cool annotation system to add comments to block. This could be leveraged to enhance the readability of the program.

Untitled

Handling Analog Input and Output

The analog I/O handling should work the same way as the digital one.

Untitled

Doing conditional statements with Pin. The Pin 3 is identified with color in the ‘if’ statement. Maybe a label on it will work better.

Untitled

Functional Programming or Object Oriented?

Since Clojure is used as programming language to drive the ArduBlock, it seems that it pushes my design of the block language to have more functional programming favor. It may be a good thing to make program more straight forward to understand and to program. But really need to guard against the tunnel vision.

Rule Engine?

Since I am using a rule engine in a project right now, I may also be influenced by that. I see all these blocks laying out conditions to trigger actions. It may be worth a while to see if a small Reta Algorithm can be easily implemented in Arduino to handle the rules layout by the blocks. This seems to be a nature way to design a run time for this language.

Design a Block Language for Arduino
Feb 14th, 2011 by david

I have been playing around with OpenBlocks. It’s a very flexible environment to create a new block language. When it comes to design one for Arduino, I found myself wondering between two different styles of design.

Design I

The first design is of course to follow the Arduino Language Reference closely. However, the resulting block language seems to be a bit too “verbose?” Or should I say “busy” since it’s really a graphical representation of the textual program. Here is a sample of what it looks like for the equivalence of codes here.

void setup() {
  pinMode(1, INPUT);
  pinMode(2, OUTPUT);
}
void loop() {
  if (digitalRead(1) == HIGH) {
    digitalWrite(2, LOW);
  }
}

Vpl 1

Design II

Since the block language is targeted at the beginner of Arduino and programming, most of time, we talk about “When the button on pin 1 is pushed, I want the LED on pin 2 to light up.” There is a much natural way to map this statement into an intuitive block language by building the blocks around the pin. Here is how it may look like:

Vpl 2

This language is more concise and easier to understand. The language itself should provide enough meta info to infer the setup codes. However, in order to do this, the language may need a little runtime (OS?) to be compiled along with the Sketch but it seems to be worth the effort.

The OpenBlocks codes I am playing around with the idea is available at my openblocks on github. Appreciate any feedback on this.

Survey of Visual Programming Languages for Arduino
Feb 14th, 2011 by david

To make Arduino easier for non-programmers, I decided to start a visual programming environment similar to Scratch for Arduino.

Similar Projects around the Web

Modkit is a similar project but at the time I wanted to start the project, it was in a closed alpha. Also, it seems that modkit is going to be proprietary and I want an open source VPL for Arduino. By the way, Modkit CrimpCards is an awesome idea and design.

S4A (Scratch for Arduino) is another interesting project but it’s for using Scratch with Arduino instead of programming for Arduino.

David Mellis over at MIT Media Lab also has a project called “Scratch for Arduino” but no detail yet. David is also one of the creator of Arduino platform.

Minibloq is another excellent environment for Arduino written by Julián Da Silva Gillig

Arduino IDE and OpenBlocks

Fork the source of Arduino IDE hosted on github to host my version here. Next stop is to find a library for the visual programming. I found a project called OpenBlocks developed as part of the MIT StarLogo NG. Open Blocks is also used in Google’s Android development tool App Inventor.

Both Arduino IDE and Open Blocks are written in Java so the integration should be smooth. Since I have done by share of Java, I decided to also use this opportunities to look into a few alternative languages running on JVM to implement this. Since I have done mostly Ruby for the past few years, JRuby looks pretty good. The language I really want to use is Clojure but it seems it’s a bit tricky to use it embedded in a Java app. Will give both a try and see how it goes.

Let the hacking beging!

Hopefully, we will have a running version in the next few weeks.

SIDEBAR
»
S
I
D
E
B
A
R
«
»  Substance:WordPress   »  Style:Ahren Ahimsa