111 block projects · Arduino · ESP32 · Pico

Block Coding for Arduino, ESP32 and Pico Projects

Follow colorful blocks instead of reading code line by line. 111 BlueGrays projects come with a block version, and every block maps to a line of the real code that runs on the board.

What is block coding?

Block coding means building a program out of puzzle-like blocks instead of typing it. "Set pin as output", "turn the LED on" and "wait 1 second" are each a block, and stacking them builds the program. No semicolons, brackets or typos to worry about, so you can focus on the logic.

BlueGrays uses its own block set, and the blocks speak your language: if the app is in English, the blocks say "repeat forever" and "write HIGH to pin". In Arduino and ESP32 projects the blocks map to C++ code; in Raspberry Pi Pico projects they map to MicroPython.

The goal is not to stay in blocks forever but to understand the code. Put a project's blocks next to its code and you can see what each line does. After a few projects you start reading the code without the blocks.

How block coding works in BlueGrays

In the app, the blocks live in the code section of every block project. Four steps:

  1. 01

    Pick a block project

    Projects with the block badge come with a block version. You can also filter the list to show only block projects.

  2. 02

    Turn on "Show as blocks"

    One switch in the code section turns the code into blocks. Tap the image to open it full screen and zoom in.

  3. 03

    Understand the blocks

    The "Understand the blocks" tab walks you through the program step by step, showing only the blocks for each step and what they do.

  4. 04

    Move on to real code

    Switch it off and the same program appears as code. Copy it into the Arduino IDE (or Thonny for the Pico) and upload it to your board.

One program: blocks and code

On the left, the project's blocks. On the right, the code that runs on the board. Every block has a matching line of code.

Blocks

LED Blink block code
LED BlinkOpen full size

Code

C++ (Arduino IDE)
1// ─────────────────────────────────────────
2//   BlueGrays · bluegrays.com
3//   LED Blink
4// ─────────────────────────────────────────
5// Blinks a single LED on and off every 100 ms. Shows the basic use of the
6// digitalWrite and delay functions.
7//
8// Pins:
9//   D9 -> LED (with a 220 ohm resistor)
10
11void setup() {
12  pinMode(9,OUTPUT);     // LED pin as output
13}
14
15void loop() {
16  digitalWrite(9,HIGH);  // Turn the LED on
17  delay(100);            // Wait 100 ms (1000 ms = 1 s)
18  digitalWrite(9,LOW);   // Turn the LED off
19  delay(100);
20}
21
Open the project: LED Blink

Block projects

Every project with a block version, by platform. Free projects come first: 31 of them are completely free, blocks and code included.

Arduino projects74 block projects

LED Blink
#1Beginner

LED Blink

The very first hello of electronics: switching a single LED on and off. The Arduino turns the LED on and off at short intervals, so the light blinks quickly. You see in the simplest way how the board

4.6(193)
1185
Two LEDs Blinking Alternately
#2Beginner

Two LEDs Blinking Alternately

Two LEDs blink quickly in turn: when one lights up the other goes off, as if they were tossing a ball back and forth. The Arduino keeps each light on for a fifth of a second and then hands over to the

4.6(105)
352
Traffic Light
#3Beginner

Traffic Light

A tiny copy of the traffic light you see on the road every day. Red stays on for two seconds, yellow flashes for a moment, green stays on for two seconds, then it goes back to red through yellow again

4.8(132)
417
LED Police Lights
#4Beginner

LED Police Lights

Just like the lights on a police car: the red LED flashes three times in quick succession, then the blue LED flashes three times, and the pattern keeps repeating without a break. All you need is two L

4.7(103)
267
LED Chaser
#5Intermediate

LED Chaser

Lights that switch on one after another, as if they were running. The Arduino lights six LEDs one at a time; each glows for a brief moment and goes out, so the light walks from start to end and then s

4.6(85)
210
Knight Rider LED Effect
#6Intermediate

Knight Rider LED Effect

The classic scanner light: a dot of light slides from one end of six LEDs to the other and then comes back. The Arduino lights each LED for a tenth of a second before moving on, turns around at each e

4.8(106)
205
LED Chaser with Adjustable Speed
#7Intermediate

LED Chaser with Adjustable Speed

Six LEDs light up one after another, so the light seems to run from one end to the other. Turn the potentiometer knob and the speed of that run changes instantly: one way and the light races along, th

4.6(72)
148
Knight Rider LED Effect with Adjustable Speed
#8Intermediate

Knight Rider LED Effect with Adjustable Speed

A light runs from one end of six LEDs to the other, turns around and runs back again. Turn the potentiometer knob and you change the speed of that run instantly: with the knob at one end the light alm

4.5(60)
122

Arduino projects: all block projects

ESP32 projects23 block projects

LED Blink with ESP32
#103Beginner

LED Blink with ESP32

Teaches basic GPIO output usage with ESP32. We achieve a blinking effect by turning an LED on and off from a digital pin. ESP32 version of the classic blink project on Arduino UNO; the basic blink commands in the Arduino environment are the same, but the ESP32's pin layout and 3.3 V GPIO levels differ from those of the Arduino UNO.

4.7(37)
101
ESP32 LED Control with Push Button (Push)
#104Beginner

ESP32 LED Control with Push Button (Push)

The LED lights up when the button is pressed and turns off when released. Shows how the ESP32's digital input pin and internal pull-up resistor are used. The INPUT_PULLUP mode eliminates the need for an external resistor.

4.6(36)
56
ESP32 LED Control with Pushbutton (Toggle)
#105Beginner

ESP32 LED Control with Pushbutton (Toggle)

Each time the button is pressed the state of the LED changes: if it is on it turns off, if it is off it turns on. Classic toggle pattern. With debounce we clean up the mechanical noise of the pushbutton to ensure a single toggle with a single press.

4.6(39)
59
ESP32 Built-in LED Blink
#106Beginner

ESP32 Built-in LED Blink

Blinking the built-in blue LED on the ESP32 DevKit V1. No external components required! The first project you should try when you buy an ESP32. GPIO 2 is connected to the built-in LED.

4.8(29)
53
ESP32 Traffic Light
#107Beginner

ESP32 Traffic Light

Real traffic light simulation with 3 LEDs red-yellow-green. Timings close to real traffic logic: red long, yellow short, green long. Classic example of sequential GPIO control.

4.4(21)
44
ESP32 Knight Rider LED
#108Beginner

ESP32 Knight Rider LED

6 LEDs moving sequentially from left to right and right to left (Knight Rider style). A basic example of using for loops and arrays. Teaches the logic of direction change.

4.5(19)
33
ESP32 LED Fade with PWM
#110Beginner

ESP32 LED Fade with PWM

Smoothly changing the brightness of the LED from 0 to max, from max to 0. We control PWM with analogWrite() as in Arduino - the same syntax as ESP32 Arduino Core 3.0+ works without problems. Pin definition + pinMode + analogWrite is enough.

4.8(36)
55
ESP32 RGB LED Control
#111Beginner

ESP32 RGB LED Control

Unlimited color generation with a single RGB LED instead of 3 separate LEDs. As in Arduino, we make a rainbow transition by setting the R/G/B values with analogWrite(). Color theory (such as red+green=yellow) is seen practically.

4.6(29)
51

Raspberry Pi Pico projects10 block projects

Raspberry Pi Pico Onboard LED Blink (Pico and Pico W)
#147Beginner

Raspberry Pi Pico Onboard LED Blink (Pico and Pico W)

The opening project of the Raspberry Pi Pico series! We blink the Pico's green built-in LED to confirm the board works, the classic "Hello World" first experiment. No external parts needed, just the Pico and a USB cable. The code is written in MicroPython, the language officially supported by the Raspberry Pi Foundation.

5.0(1)
10
Raspberry Pi Pico: Controlling an External LED (Breadboard)
#148Beginner

Raspberry Pi Pico: Controlling an External LED (Breadboard)

The next step after the Pico's built-in LED: connect an external LED on a breadboard and control it through pin GP14. You'll learn how to use any of the Pico's GPIO pins as an output, the LED's polarity (long leg = anode/+, short leg = cathode/–) and why a current-limiting resistor (220Ω) is a must. Without the resistor, too much current flows through the LED and it can burn out.

4.5(2)
7
Raspberry Pi Pico Alternating Two LEDs (Blink-Flip Pattern)
#149Beginner

Raspberry Pi Pico Alternating Two LEDs (Blink-Flip Pattern)

The next step after the Pico's single LED: the classic flip-flop animation, with two LEDs blinking in turn. One LED turns off as the other turns on, the most basic example of handling multiple GPIOs. Two LEDs of different colors (red on GP14, green on GP13) swap every 500 ms. With MicroPython's Pin.toggle() method, the code stays short and readable.

5.0(2)
19
Raspberry Pi Pico Traffic Light Simulator (3 LEDs Sequential)
#150Beginner

Raspberry Pi Pico Traffic Light Simulator (3 LEDs Sequential)

We recreate real traffic light logic with red, yellow and green LEDs, the first Pico project to move up to 3 LEDs! Green says "go" for 4 seconds, yellow "get ready" for 1.5 seconds, red "stop" for 3 seconds, and red+yellow "set off" for 1 second (the European traffic light pattern). You'll learn to define functions (def all_off()), state machine logic and multi-GPIO synchronization.

4.0(1)
12
Raspberry Pi Pico Police Strobe Light Effect (Red + Blue)
#151Beginner

Raspberry Pi Pico Police Strobe Light Effect (Red + Blue)

We simulate a police car's light bar with a Raspberry Pi Pico in its simplest form! The red and blue LEDs take turns (flip-flop): while red is on, blue is off, and they swap every 0.3 seconds, forever. The code writes the two steps directly in a single while True loop; the speed is set with the WAIT_MS constant.

4.7(3)
10
Raspberry Pi Pico 3-Burst Police Flip-Flop (2 LEDs)
#152Beginner

Raspberry Pi Pico 3-Burst Police Flip-Flop (2 LEDs)

Rhythmic variation of the police strobe project — 3-burst flip-flop! Same 2-LED circuit (GP11 red + GP12 blue), but a different pattern: red LED flashes 3 times rapidly, then blue flashes 3 times, forever. This "burst + switch" pattern is the most recognizable rhythm of real police siren lights. Learn parametrized function def burst(led, count, duration_ms), rhythm design, and generating different visual effects with code on same circuit.

15
Raspberry Pi Pico Button Toggle LED
#156Beginner

Raspberry Pi Pico Button Toggle LED

Button + LED — next level! Unlike the basic button project, there is no need to hold the button. Press and release → LED on. Press and release again → LED off (toggle). Same circuit (LED GP14, Button GP2), but big code difference. Learn edge detection (capturing the 1→0 falling moment), state tracking, debounce (mechanical bounce filter). MicroPython's led.toggle() swaps state in one line. Foundation of all interactive button projects (mode switcher, IRQ, double-click).

9
Raspberry Pi Pico PWM LED Fade (Breathing Effect)
#160Beginner

Raspberry Pi Pico PWM LED Fade (Breathing Effect)

The LED doesn't just blink anymore, it breathes! With the Raspberry Pi Pico's PWM (Pulse Width Modulation), the LED's brightness slowly rises and then slowly fades, a calm "breathing" effect like a sleeping laptop's light. You'll learn the machine.PWM class, the 16-bit brightness value from 0–65535 with duty_u16() and the PWM frequency.

4

Who is it for?

Kids and parents

Coding for kids sticks much better when it ends with an LED lighting up on the desk. The blocks make the program readable, and you build the circuit together.

Teachers and clubs

In a robotics or STEM class you can explain a project with blocks first, then move on to its code. Every project has a parts list and a circuit diagram ready.

Beginners

Arduino block coding is the fastest way to get the logic in your first few projects. Start with blocks and switch to code when you feel ready.

Frequently asked questions

What is block-based coding?

It is a way of programming where commands are shown as blocks that snap together like puzzle pieces instead of typed text. Since you cannot make typos, beginners and kids grasp the logic of a program more easily.

How many BlueGrays projects come with blocks?

Right now 111: 76 Arduino, 25 ESP32 and 10 Raspberry Pi Pico projects. The list grows as more projects are converted.

Is block coding free?

The app is free. The blocks and code of 31 block projects are open to everyone. In the other projects the blocks unlock with Premium, just like the code.

Can I upload the blocks straight to my board?

No. The blocks make the program easier to read and understand; what goes onto the board is always the project's real code. You copy it into the Arduino IDE, or Thonny for the Pico, and upload it.

Can I build my own programs with the blocks?

Not yet. We prepare the blocks for each project and match them to the code one to one, so the blocks you see always stand for a tested program that works.

How is this different from Scratch or mBlock?

In Scratch and mBlock you drag blocks around on a computer to write your own program. In BlueGrays every block project comes with a circuit diagram, a parts list and the real code, and the blocks are a readable version of that code. The two complement each other.

Is it suitable for kids? What age can they start?

Kids around 9 or 10 who read comfortably can start together with an adult. The first projects need no soldering: they are built on a breadboard with LEDs, buttons and a buzzer.

Which languages are the blocks in?

English, Turkish, German, Spanish, French and Italian. The blocks appear in whatever language you use the app in.

The BlueGrays app

Start block coding on your phone

Blocks, circuit diagram, parts list and real code on one screen. Free on iOS and Android.

Download on the App StoreGet it on Google Play

Platform pages