Tinkercad Circuits Code Blocks

Tiffany Tseng
6 min readSep 26, 2017

Visual Programming for Arduino, powered by Scratch Blocks

Our newest feature in Tinkercad Circuits is visual code blocks–powered by Scratch Blocks!

We* designed code blocks to make learning how to program with Arduino as easy as possible. With that in mind, our main goals were to,

  1. Simplify the Arduino programming experience to reduce common syntax errors (such as mistyping the name of a function or forgetting a semi-colon)
  2. Focus on the desired interaction (what you want to sense and control), while scaffolding all the necessary setup required to do so
  3. Bridge the worlds of visual programming and text-based programming to make everything created in Tinkercad Circuits extensible to real, physical hardware using the Arduino IDE

Here, I’ll provide an in-depth explanation of how code blocks work while describing how our design philosophy wove into the creation of this feature.

*We = The Tinkercad Circuits Team (Joshua Brooks, Lead Software Developer, & Myself, Lead UX)

Code Blocks — An In-Depth Example

Tinkercad code blocks are visual blocks you can drag-and-drop to create Arduino programs. Using the Tinkercad Circuits simulator, you can test any code you create directly in the browser, before you build and program your devices with real physical components.

Controlling a servo motor with a potentiometer using Tinkercad Code Blocks

Code blocks are organized into several categories:

  • Output — Blocks for controlling actuators connected to your programmable microcontroller
  • Input — Blocks for reading sensor input
  • Notation — Blocks for adding comments, both to provide an overview of your code (in the title block) and in-line with your code
  • Control — Control structures like adding delays, repeating, and if else statements
  • Math — Blocks for logic and computation
  • Variables — Custom variables that can be edited in your program
Tiffany Tseng

designing tools for making.