Skip to content
AutomationDirect edited this page Jan 28, 2020 · 54 revisions

Welcome to the ProductivityBlocks Wiki!

Here you will find documentation for the ProductivityBlocks tool along with several tutorials. Each block has a page with a description and a summary of the block's usage. Use the navigation pane on the right to find the information you need. Below is a quick introduction to the software.


Getting Started

ProductivityBlocks is a graphical block programming tool that writes c++ code to the Arduino IDE.

Each block represents a piece of a program that will run on Arduino CPUs.


Making a Program

To create a program, use the tabs on the left side of the application to select a block category:

Then click and drag the desired block into the main canvas. Blocks snap into place when dragged close enough to a connector with the right shape.

To delete a block from the main canvas, drag it over the tabs on the left of the screen and release.

Saving and Loading Programs

Use the 'Save' or 'Save As' buttons to save a block program. To load a block program, select 'Open' and choose the '.apb' file you would like to load.

Example Programs

If you installed ProductivityBlocks using an installers in the releases, you should have example programs located in

.../Documents/Arduino/ProductivityBlocks/Examples


Uploading a Program

Note: Before uploading or verifying a block program, check the preferences in the Arduino IDE under 'File->Preferences'. If the option 'Save when verifying or uploading' is checked, the 'Verify' and 'Upload' buttons will overwrite your current Arduino Sketch.

Once a block program has been created, click the 'Verify' button to check the generated c++ code:

When the program is ready, use the 'Upload' button to push the program to a connected Arduino board.


Block Programming Basics

There is a special bock called Program that represents an entire Arduino Sketch:

After placing one of these blocks on the main canvas, the rest of the program can be created by snapping other blocks onto its connectors. Blocks that are not attached to it will not generate any text.

Note that block programs must only have one of these special blocks in the main canvas, otherwise it will not be able to 'verify' or 'upload'.

Block Types

There are four different kinds of blocks:

1. Program Block:

Contains the c++ program to be loaded onto an Arduino board (as described above).

CAUTION:

  • If you are not using P1 modules, you must set the 'Use P1 Modules' to 'false'. Otherwise the Program block will not run.
  • If you are using P1 modules, ensure they have power, otherwise the program will not run.

2. Command Blocks:

Processes to be done in the program.

3. Function Blocks:

Processes that return a value to be used in the program.

4. Data Blocks:

Variables and constants.

Data Types

There are 5 different basic data types in ProductivityBlocks. Each type has a variable block and a constant block to go with it. For more information on variables and constants, see the Variables & Constants page.

Usage Notes:

  • When selecting the 'verify' or 'upload' buttons, ProductivityBlocks will write text to the active tab in the Arduino IDE.
  • When using multiple instances of the Arduino IDE (having multiple windows open), each window may have a separate instance of ProductivityBlocks running with it. Take note of this when you open ProductivityBlocks for each Arduino IDE window so that you can keep track of this pairing.

Useful Links:

Clone this wiki locally