Blocks: all pages

Copy or download the code

On this page you copy the Arduino code made from your blocks to the clipboard, or download it as an .ino file. You upload the code to the board with Arduino IDE.

Probot Blocks screen; the Tank Drive example is loaded and the generated code shows in Code Preview.

Before you start

Download the code as an .ino file

  1. In the toolbar, type a project name into the Project box, for example Tank Drive. The file name is made from this name.
  2. In the toolbar, press Download .ino. A ".ino file downloaded." notification appears. Toolbar; the Download .ino button is marked with number 2.
    1. If the browser asks where to save the file, press Save.

Result: Your Downloads folder has a <project-name>.ino file, for example tank-drive.ino. The name is changed to lower case, Turkish letters become plain letters, and characters that are not letters or digits become -. A capital İ becomes i- (İleri → i-leri.ino). If the Project box is empty, the file is probot-projesi.ino.

Copy the code to the clipboard

Tip

If the browser does not allow access to the clipboard, you see "Copy failed." In that case, use Download .ino.

  1. In the toolbar, press Copy code. A "Code copied to the clipboard." notification appears.
  2. In Arduino IDE, open a new sketch.
  3. Delete the text that is already in the sketch. Make sure no setup() or loop() is left in it.
  4. Paste the code with Ctrl+V. On a Mac, use Cmd+V.

Result: The sketch starts with the line // Generated with Probot Blocks - probotstudio.com/blocks and ends with the void teleopLoop() function.

What is in the code

The code in Code Preview has these parts, from top to bottom:

If a lifecycle block is empty, its function contains the comment // No blocks added yet. Blocks does not write setup() or loop(). The library provides them.

The probot-core 0.3 text in the toolbar shows which library version the code is generated for. Press it to open the Probot Core documentation. That documentation describes a newer version, and it mentions functions that Blocks does not generate, such as autonomousStop().

Next step

Upload the code to the Probot board

On this page
Before you startDownload the code as an .ino fileCopy the code to the clipboardWhat is in the codeNext step