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
Blocks first
Make a small program:
on button A pressed → show icon heart, andforever → rainbow, pause 50.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.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.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.
Arduino IDE
Menu ☰ → Save Arduino sketch (.ino) and Arduino library (.zip) to open the same program in the Arduino IDE.
Back to blocks
An Arduino sketch replaces the TinkerPie runtime. To use blocks and Download again, menu ☰ → Install / update runtime.