111 block project · Arduino · ESP32 · Pico

Block coding para sa mga Arduino, ESP32 at Pico project

Sundan ang makukulay na block sa halip na basahin ang code linya por linya. 111 BlueGrays project ang may block version, at bawat block ay katapat ng isang linya ng totoong code na tumatakbo sa board.

Ano ang block coding?

Ang block coding ay pagbuo ng program mula sa mga block na parang puzzle sa halip na i-type ito. Tig-iisang block ang "Itakda ang pin bilang output", "i-on ang LED" at "maghintay ng 1 segundo", at nabubuo ang program kapag pinagpatong-patong ang mga ito. Walang semicolon, bracket o typo na kailangang alalahanin, kaya makakapag-focus ka sa lohika.

May sariling block set ang BlueGrays, at nagsasalita ng wika mo ang mga block: kung English ang app, nakasulat sa mga block ang "repeat forever" at "write HIGH to pin". Sa mga Arduino at ESP32 project, katapat ng C++ code ang mga block; sa mga Raspberry Pi Pico project, katapat ng MicroPython.

Ang layunin ay hindi manatili sa block magpakailanman kundi maunawaan ang code. Itabi ang mga block ng isang project sa code nito at makikita mo kung ano ang ginagawa ng bawat linya. Pagkatapos ng ilang project, makakabasa ka na ng code kahit walang block.

Paano gumagana ang block coding sa BlueGrays

Sa app, nasa code section ng bawat block project ang mga block. Apat na hakbang:

  1. 01

    Pumili ng block project

    May kasamang block version ang mga project na may block badge. Puwede mo ring i-filter ang listahan para block project lang ang lumabas.

  2. 02

    I-on ang "Ipakita bilang block"

    Isang switch sa code section ang nagpapalit sa code bilang mga block. I-tap ang larawan para buksan ito nang full screen at i-zoom.

  3. 03

    Unawain ang mga block

    Ginagabayan ka ng tab na "Unawain ang mga block" sa program nang hakbang-hakbang, ipinapakita lang ang mga block ng bawat hakbang at ang ginagawa ng mga ito.

  4. 04

    Lumipat sa totoong code

    I-off ito at lalabas bilang code ang parehong program. Kopyahin ito sa Arduino IDE (o Thonny para sa Pico) at i-upload sa board mo.

Iisang program: mga block at code

Nasa kaliwa ang mga block ng project. Nasa kanan ang code na tumatakbo sa board. May katapat na linya ng code ang bawat block.

Mga Block

Block code ng LED Blink
LED BlinkBuksan sa buong laki

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
Buksan ang project: LED Blink

Mga block project

Bawat project na may block version, ayon sa platform. Nauuna ang mga libreng project: 31 sa mga ito ang ganap na libre, kasama ang mga block at code.

Mga Arduino project74 block project

Mga Arduino project: lahat ng block project

Mga ESP32 project23 block project

LED Blink with ESP32
ES-1Baguhan

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)
108
ESP32 LED Control with Push Button (Push)
ES-2Baguhan

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)
57
ESP32 LED Control with Pushbutton (Toggle)
ES-3Baguhan

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
ES-4Baguhan

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)
54
ESP32 Traffic Light
ES-5Baguhan

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(22)
45
ESP32 Knight Rider LED
ES-6Baguhan

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
ES-8Baguhan

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
ES-9Baguhan

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)
52

Mga Raspberry Pi Pico project10 block project

Raspberry Pi Pico Onboard LED Blink (Pico and Pico W)
PI-1Baguhan

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)
PI-2Baguhan

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)
PI-3Baguhan

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)
PI-4Baguhan

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)
PI-5Baguhan

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)
PI-6Baguhan

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.

5.0(1)
16
Raspberry Pi Pico Button Toggle LED
PI-10Baguhan

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).

10
Raspberry Pi Pico PWM LED Fade (Breathing Effect)
PI-14Baguhan

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

Para kanino ito?

Mga bata at magulang

Mas tumatatak ang coding para sa mga bata kapag nagtatapos ito sa LED na umiilaw sa mesa. Ginagawang madaling basahin ng mga block ang program, at sabay ninyong bubuuin ang circuit.

Mga guro at club

Sa robotics o STEM class, puwede mong ipaliwanag muna ang project gamit ang mga block, tapos lumipat sa code nito. May handang listahan ng piyesa at circuit diagram ang bawat project.

Mga baguhan

Ang Arduino block coding ang pinakamabilis na paraan para makuha ang lohika ng mga una mong project. Magsimula sa mga block at lumipat sa code kapag handa ka na.

Mga madalas itanong

Ano ang block-based coding?

Isa itong paraan ng programming kung saan ipinapakita ang mga command bilang mga block na nagkakabit-kabit na parang puzzle piece sa halip na tina-type na text. Dahil hindi ka puwedeng magkamali sa pag-type, mas madaling nauunawaan ng mga baguhan at bata ang lohika ng program.

Ilang BlueGrays project ang may mga block?

Sa ngayon, 111: 76 Arduino, 25 ESP32 at 10 Raspberry Pi Pico project. Lumalaki ang listahan habang mas maraming project ang kino-convert.

Libre ba ang block coding?

Libre ang app. Bukas sa lahat ang mga block at code ng 31 block project. Sa ibang project, naa-unlock ang mga block gamit ang Premium, gaya ng code.

Puwede ko bang i-upload nang diretso ang mga block sa board ko?

Hindi. Pinapadali ng mga block na basahin at unawain ang program; ang laging napupunta sa board ay ang totoong code ng project. Kokopyahin mo ito sa Arduino IDE, o sa Thonny para sa Pico, at ia-upload.

Puwede ba akong bumuo ng sarili kong program gamit ang mga block?

Hindi pa. Inihahanda namin ang mga block para sa bawat project at itinutugma ang mga ito sa code nang isa-isa, kaya laging kumakatawan ang mga block na nakikita mo sa isang na-test na program na gumagana.

Paano ito naiiba sa Scratch o mBlock?

Sa Scratch at mBlock, nagda-drag ka ng mga block sa computer para isulat ang sarili mong program. Sa BlueGrays, may kasamang circuit diagram, listahan ng piyesa at totoong code ang bawat block project, at ang mga block ay madaling basahing bersyon ng code na iyon. Nagtutulungan ang dalawa.

Bagay ba ito sa mga bata? Ilang taon sila puwedeng magsimula?

Puwedeng magsimula kasama ang isang adult ang mga batang nasa 9 o 10 taong gulang na mahusay nang magbasa. Walang kailangang paghihinang sa mga unang project: binubuo ang mga ito sa breadboard na may LED, button at buzzer.

Sa anong mga wika ang mga block?

English, Turkish, German, Spanish, French at Italian. Lumalabas ang mga block sa wikang ginagamit mo sa app.

Ang BlueGrays app

Magsimula ng block coding sa phone mo

Mga block, circuit diagram, listahan ng piyesa at totoong code sa iisang screen. Libre sa iOS at Android.

Download on the App StoreKunin ito sa Google Play

Mga platform page