12Blocks
Welcome | Contents | Getting Started | Reference | Hardware | FAQ | Buy
Blog | Forum
Overview | Your First Program | Ideas to get going

Interface Overview

Interface Overview

12Block’s interface consists of a Library, a Worksheet and a Toolbar:
graphic

Programming in 12Blocks involves dragging blocks from the Library to the Worksheet and then using the Toolbar to run your program.

The Library
You will find all sorts of blocks in the library- to play music, draw graphics, move robots and more. The library is organized into sections to help you find the right block.  12Blocks has  libraries to support popular hardware platforms.  You can even add your own blocks- see: custom library
Click the Library name to change to a library for a different device- the above shows the "Arduino" library.  Choose the appropriate level by clicking on the level in this case "Advanced".

The Worksheet
To create a program, use your mouse to drag blocks from the library onto your worksheet and snap them together.  Later on you'll see how to use Undo/Redo and the clipboard for advanced editing.  The shape of the block indicates how the block attaches to other blocks- here are some examples:
graphic
Most programs use one or more <start> blocks.  Notice that this block does not have a tab on the top- you can only add blocks below it, like the <wait> block in this example. Change the parameter of blocks by clicking on the yellow area, in this case to change how many milliseconds to wait. 
 
graphic
In this example, the <toggle pin> block is attached inside the <repeat> block. This program fragment will toggle pin 0 ten times.  Notice that the repeat block attaches to the top, inside and bottom.
 
graphic
Here we've dragged the argument block <mousex> into the <if> condition parameter.  Notice that we can combine blocks and text inside the yellow parameter regions.  Also notice the comment block- click on the italicized text to change it.

Toolbar
graphic
Run your program by pressing the "Run" button.  Pause the program's update with the pause button.  Stop the program from running by pressing "Stop".  Permanently load a program with the "Burn" button.  Some devices (TBot, Scribbler, NXT, Arduino) can be interactively controlled with the "Control" button.  Set the port by clicking on the port.  Set how your program will runby clicking on the "Mode".

Tutorial

This tutorial will use the Arduino.  If you're looking for other tutorials including videos visit:
http://onerobot.org/tag/getting-started/

Pre-requisites:
·     12Blocks should be installed
·     Propeller turned on and connected to this PC

Tutorial
Start 12Blocks and at the Welcome Screen, select "Guided Tutorial". 
graphic

Select "blink" and "load" and you'll be guided to build your first program:
graphic

If you follow the instructions and hints you'll end up with a program that blinks an LED- here is what it'll look like:
graphic



  

Getting Started Guide

The Getting Started Guide is a great way to explore the possibilities of programming with 12Blocks.  It walk you through several dozen exercises that increase in complexity- from blinking LED's to Fibonacci numbers, arrays and recursion.


To view the guide, start 12Blocks and at the Welcome Screen, select "Getting Started Guide". 
graphic


You can also download the tutorial here: http://onerobot.org/download/12b_tutorial.pdf