TINKER PIEDESIGN IN INDIA

From blocks to Arduino C++

See your blocks as real Arduino C++, change it, and build & flash it from Studio. Advanced · 15 min

Start this tutorial in TinkerPie Studio

  1. Blocks first

    Make a small program: on button A pressed → show icon heart, and forever → rainbow, pause 50.

  2. The C++ tab

    Click Arduino C++ at the top. This is the same program in C++: input::onButtonPressed(Button::A, []() { … }); Every block becomes one line.

  3. Read the parts

    setup() runs once (the on start blocks and the events). loop() runs the forever blocks. []() { } is a small function for an event.

  4. Build & Flash

    Press Build & Flash. The first time, Studio installs the Arduino compiler on this computer (one click, about 10 minutes). Then it compiles and puts the program on the board.

  5. Arduino IDE

    Menu ☰ → Save Arduino sketch (.ino) and Arduino library (.zip) to open the same program in the Arduino IDE.

  6. Back to blocks

    An Arduino sketch replaces the TinkerPie runtime. To use blocks and Download again, menu ☰ → Install / update runtime.