Documentation / Quickstart / Quickstart

Quickstart

Installing BrainBuilder Development Studio

Downloading and installing is outlined here: Download and install BrainBuilder Development Studio

Setting up a new project

In this guide, an example project is built with Arduino Uno board, a light sensor and an LED.

Start the BrainBuilder Development Studio

BrainBuilder Development Studio

Go to Cloud, Login to connect to the BrainBuilder Cloudservice:

Cloud login

This will open the BendyRoad sign-in page. Click on ‘Create account’ to create a login.

BrainBuilder Development Studio

Once you have set up your account, return to the BrainBuilder Studio and again choose: Cloud, Login

A browser window will open and ask if it is OK to link this workstation. Confirm this and return to the Development Studio.

Define the type of development board

Add a Hardware item (left-click on the ‘Hardware’ folder).

Adding hardware

Select the development board you are using. At the moment Arduino Mega and Arduino Uno are supported.

Arduino Uno block

Give it a name, for example ‘myUno’.

Arduino Uno block x

Connect the development board

Physically connect the board.

Laptop and development board

Go to ‘Tools’, then ‘Search programmer’

This will autoscan for a development board. Sometimes it can take a while to try a few ports before the board is found. (Only one connected board at the same time is supported)

Autoscan development board

Adding hardware

Display

If you have a Arduino Display shield or a generic LCD Display, you can add that too in the same way.

LEDs

Arduino Uno and Mega have an on-board LED that is already configured and available as ‘led1’. Other LEDs you can add yourself.

Input

With analog and digital inputs, you can define which sensors or switches are connected to which pins.

Example: For using an analog temperature sensor on analog input pin 2, use an Analog Input block, name it ‘temp’ and specify the port as ‘2’.

Analog input

Tip: by clicking on any of the field descriptions, help texts are displayed, as in this example by clicking on ‘Analog port’.

This automatically adds the variable temp. The list of variables on the right-hand side of the screen is updated with the new variable.

Output

Example: A switch connected to Digital Output port ‘D12’

Switch

Adding logic

Rule blocks specify actions based on conditions. For example, to switch ‘led2’ on when ‘temp’ level over 23, and off if is below, add a rule like this:

 if ( temp > 23 ) {
     led2 = 1; 
 } else { 
     led2 = 0 ; 
 }
Example of a rule

Global variables

Input blocks implicitly make variables available with the name of that block. For example ‘Light’. But if it is easier to work with the inverse value, we can define a Global Variable with the name ‘LightInverted’ and type U16. Then we can add a Rule Block to set the variable ‘LightInverted’ to ‘1024 - Light’.

Showing output

If you have a LCD connected to your Arduino, add it as a hardware item:

Arduino display

Next, add a ‘Screen’ under ‘Screen Definitions’. This will create a ‘Screen Item List’, to which you can add ‘Screen cells’.

A screen cell is the easiest way to display a text and a value together.

For example, to show the ADC value from the temperature sensor on the display, specify text ‘Temp.: ‘, and a value from a temperature sensor (temp).

The Arduino display has two rows of 16 characters. Numbering starts at 0. An easy way to get the lay-out correct is to use grid paper.

Screen cell

Generating and programming firmware

Click ‘Firmware.. Generate’ to generate the firmware image.

Generate firmware

Saving the project file

It’s convenient to create a folder to store your projects in. The folder is remembered for the next times you start BrainBuilder.

You can enter project information on the Project Info page. There’s room for a description and notes.

Reordering blocks

You can drag and drop blocks to reorder them, and organize them in folders, to logically group blocks together.