Documentation / Quickstart / Quickstart

Quickstart

Installing BendyRoad BrainBuilder

Downloading and installing BrainBuilder is outlined here: Download and install BendyRoad BrainBuilder

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 client

BrainBuilder Client

Go to Cloud, Login to connect your client to the BrainBuilder cloud service:

BrainBuilder Client

This will open the BendyRoad login page. Go to New User to create a login.

BendyRoad login

Connect a development board

Pysically connect the board, and check that it is recognized and connected on the correct USB port in Options..Programmer tab:

OptionsProgrammerTab

Adding blocks

Development board

The first block to add, is a development board. For example: Arduino Uno, Mega or Nano board, or Generic AVR-8.

AddCPUBlock

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 can be added as Digital outputs.

Input

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

Example: For using an analog light sensor on analog input pin 1, use a Analog Input block, name it ‘Light’ and specify the port as ‘1’.

Analog input

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

Output

Digital output blocks are used to perform actions like operating a switch or turning on an LED. Example: For using a LED connected to Digital Output port ‘D12’, use a Digital Output block, name it ‘GreenLed’ and specify the port as ‘D12’.

Digital Output

Rules

Rule blocks specify actions based on conditions. For example, to switch ‘GreenLed’ on when the ‘Light’ level is less than 200, and off if the light level is higher than that, add a RuleBlock, name it ‘LedOn’ and the following rule:

if ( Light < 200 ) { Led = 1; } else { Led = 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

Add a ‘Screen’ under ‘Screen Definitions’. This will create a ‘Screen Item List’.

Adding a screen item

and define which variable should be displayed. For example, to show the ADC value from the light sensor on the display, specify the variable ‘Light’, and give it the label ‘L:'. The label is the text preceding the value of the variable on the LCD display. The label can be any text, but it has to be short enough to fit on the display.

Screen item

Generating and programming firmware

Click ‘Firmware.. Generate’ to generate the firmware image. The ‘Flash’ option can be used when you want to flash a second devboard with the same firmware.

Generate firmware

Saving the project file

It’s convenient to create a folder to store your projects in. BendyRoad remembers the folder automatically.

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