12Blocks
Welcome | Contents | Getting Started | Reference | Hardware | FAQ | Buy
Blog | Forum
Overview | Editor Interface | Editor Dialogs | Advanced | Language | Blocks

Device Manager

Device Manager

Selecting a Device
Use the Device Manager to select which device to use and how to use it.  The "Device Overview" shows information about the currently selected device. 
graphic

Device Configuration
The right side of the dialog let's you customize the device.  The exact options will differ between devices. 

The "Device configuration" text editor let's you edit the configuration for the selected device and type.  The default configuration is specified in the device's "device.xml" file in the "custom" nodes. To reset to those defaults, click on the "reset to defaults" button. 

Lines prefaced by a '$' are used by 12Blocks.  For example, the "Nano" type of the "Arduino" device includes this line:
$build=upload=57600,clock=16000000,chip=atmega328p
to specify how to build and load programs.

Lines not prefaced by a '$' will be copied to the generated text code in place of the "$custom" string.  For example the "Mindstorm" device as shown above specifies the following 2 lines:
short _movec=21; //use 21 for wheeled and 51 for tracked bots
short _turnc=19; //use 19 for wheeled and 31 for tracked bots

Those variable assignments will be included in every program generated for the Mindstorm device.  The _movec and _turnc variables are used by the "motion" blocks to move a desired distance and turn a specified number of degrees.
  

Program Preferences

·     Graphics output: you can configure how your microcontroller should output graphics- either to a TV or a VGA     
·     Runtime link: 12Blocks normally sets up a link with your microcontroller when you run a program.  This allows you to view what your program is doing and make changes.  You can disable that functionality here.
·     Show Splash Screen: Shows the splash screen normally shown at the start of the program.
·     Scale graphics for saving: When files are saved as a graphic, this scale factor is used to size the image.

graphic

Mode Selector

12Blocks lets you select a mode to use for running your program.  Here is more detail for each choice:
·     Device: 12Blocks will generate text code that will run natively on the device.  Actions like the "move" block will cause the device to move forward in the real world by powering the drive motors for some time.  The program runs without the help of 12Blocks on the device.
·     RobotSim: 12Blocks will emulate the actions of each block in the program since the code will not be running on a device.  Actions like the "move" block will cause the simulated device in the RobotSim simulator to move virtually.  No code is run on the device, everything is simulated.
·     Hybrid: 12Blocks will emulate the actions of control blocks but will direct the real device to carry out blocks that affect the real world like moving and sensing.  The program is running within 12Blocks but the device is moving and sensing.
·     12Blocks: 12Blocks emulates the actions of all blocks.  Actions like the "move" block cause a simulated device to move in the "interface:simulator" block.  Everything is simulated within 12Blocks.


graphic

Port Manager

Use the Port Manager to configure how 12Blocks will communicate with your device.  By default, 12Blocks will automatically manage your ports.  You can override the automatic mode by manually specifying which port to use.

Automatic Mode
Choose "Automatic" to scan all ports for your device.  12Blocks will indicate which port is being used in automatic mode by prefixing the port name with a '*".  In the image below notice how the current mode is: "*COM1".  This means 12Blocks is in automatic mode and is currently using port COM1.  If COM1 were no longer available it would scan other ports and could use COM78 if that was connected to the currently selected device.

Manual Mode
You can manually select a port and 12Blocks will only use that port to communicate with devices. Selecting COM1 in the image below would restrict 12Blocks to only use COM1.
graphic

Port Details
Advanced users can click the "Edit Port Details" tab in the Port Manager to edit details like the name to display for the port and it's baud rate.  Tick the "Use as Bluetooth" checkbox if using a bluetooth serial connection to the device.
graphic

  

Control Interactively


This dialog is used to interactively control your device.  Press the buttons in the "move" section to move your device at a configurable speed and time.  Press the "action" buttons to make sounds or control servos. Pressing buttons creates a "script" which can be inserted into your worksheet as blocks.  The "sensors" area shows real-time measurements from the device's sensors.
graphic