Topic Introduction — Basic Control
You may have wondered how neon lights create such colorful effects, or perhaps you are fascinated by self-driving cars. Why can they produce so many effects just by being powered on? Behind it all lies the ingenious design of basic control systems in electronic circuits. A basic control system is like a silent conductor, orchestrating every “note” in the electronic world.
In this first stage of learning, we will use the UNIHIKER K10 to build projects, understand the fundamentals of electronic systems, and uncover the mystery of basic control.
Project 1: Light Up an LED
Unlike the last project, where we ran example programs, here we start with connecting an external LED. Step by step, we will learn the control logic of turning a single-color LED on and off, understand the basics of output control, and grasp the process of pin control, thereby mastering the principles of digital signal output.
Project Objectives
Knowledge Goals
1.Understand the concept of pins.
2.Learn what digital signals are.
3.Control digital output on the UNIHIKER K10.
Practical Goals
Use the digital pin output function of UNIHIKER K10 to control the LED turning on and off.
Materials List

Preparations
Hardware
Connect the LED module to the P0 pin of the UNIHIKER K10 using module cable.

Then use a USB cable to connect the UNIHIKER K10 to the computer.

Software
Open Mind+ v2, switch to "Upload Mode", then connect the UNIHIKER K10 as shown below and load the UNIHIKER K10 library.

Hands-on Practice
Next, we will learn to control the LED lamp through two tasks.
Task 1: Light up an LED
Use the UNIHIKER K10 to turn on the LED and learn the method of digital pin output.
Task 2: Turn the LED off after lighting
Continue using the digital pin output method to turn the LED off after it stays lit for a while.
Task 1: Light Up an LED Light
Code
In the UNIHIKER K10 graphical library, find "digital (P0) output (LOW)" block, and drag it below the "unihiker k10 on start" in the scripts area. Then, you can switch"LOW"to"HIGH". The complete code is shown in the figure on the right below.

Tip: Click the magnifying glass icon in the block area, enter keywords like "digital" in the search box, and quickly locate the desired block. See the operation diagram below.

Run the Code
Click the“Upload”button, wait for the upload to complete, and then you will see the connected LED light light up.

Block Review
Category | Blocks | Function |
![]() | Serve as the start program instruction for the UNIHIKER K10. | |
![]() | Set pin output high or low level. | |
![]() | It is used to control the continuous operation of the program. Instructions for continuous operation need to be dragged into the loop execution block. |
Task 2: Turn the LED off after lighting
Code
We can already light the LED. Now just copy the block to achieve the effect of lighting it, waiting for a while, then turning it off.
The complete program code is shown below:

Run the Code
Click the “Upload” button, wait for the upload to complete, and you will see the connected LED light light up, wait for 1 second, and then turn off.
Code Review
Category | Blocks | Function |
![]() | This block is used for delayed waiting. When this instruction is executed, it will wait for the specified time and then continue to execute the program below. |
Knowledge Base
Next, let's learn and summarize the hardware knowledge used in this lesson.
Pins
Earlier, we used the P0 pin. Do you know what a pin is?
A pin is a terminal connecting an integrated circuit’s internal and external circuits. Simply put, it is the UNIHIKER K10’s external interface, namely I/O (Input/Output). Pins are usually labeled with letter-number codes, e.g., P0.
Common pin types are shown in the figure below.

Pins can read external data and control external devices, corresponding to two functions: input and output.
- Input transmits external data to the core of the development board for processing;
- Output sends processed data for communication or peripheral control.

Generally, a pin cannot serve as both input and output simultaneously.
The UNIHIKER K10 has two built-in pins (P0 and P1). They can be used as both input and output (not simultaneously), hence named full-function I/O.

What is a Digital Signal?
Digital signals are represented by 0 and 1, deriving from the two states (on/off) of logic circuits—1 stands for circuit on (high level, close to the development board's operating voltage), while 0 stands for circuit off (low level, close to 0V). For example, 3.3V is the high-level standard of the UNIHIKER K10.
The corresponding relationship is shown in the figure below.

Why does setting digital pin P0 to high level turn on the LED, and low level turn it off? Actually, controlling the LED’s on/off relies on digital signal output control.
Digital Output Signal
Digital output signals refer to high and low level outputs, which correspond to two circuit states: on and off. “digital (P0) output (HIGH)” turns the circuit on and the LED on. Similarly, “digital (P0) output (LOW)” turns the circuit off and the LED off.

Of course, digital output signals can control more than just LEDs. Among your equipment, there is also a fan module controllable via digital output signals. Like the LED module, it is marked with "D".

LED light
LED is a standard light-emitting diode, a type of diode. A diode is an electronic component that allows current to flow only in one direction, like a one-way valve, blocking reverse current. It prevents accidental short circuits between power and ground in circuits, protecting other components.
Its circuit symbol is arrow-shaped: the arrow points in the direction of current flow, while the reverse direction is blocked. See the diagram of the diode component and current below.

An LED is also a diode—a light-emitting one. Its circuit symbol is shown below. Unlike ordinary diodes, an LED emits light when conducting current.

LEDs can emit light of different colors and brightness levels, including ultraviolet (UV) and infrared (IR) rays in the optical spectrum. (For example, the LEDs on various remote controls we often use are one such type. They look the same as ordinary light-emitting diodes, but the light they emit is invisible to the human eye — this is what we also refer to as an infrared emitting diode (IRED).)
LEDs emit light of different colors and brightness, including ultraviolet and infrared light in the spectrum(luminous range is shown below.). For example, the LEDs in common remote controls are one type—they look the same as regular LEDs but emit invisible light, also called infrared emitters.

The LED we use is monochromatic, with an operating voltage of 3.3–5V, meaning UNIHIKER K10 can drive it. Simply outputting a high level will light it up.
Here comes the question: Where is the power supply connected to the LED? Just look closely at the connection ports you used—you will surely find them, as shown below. Now you know how the LED lights up, right?

Challenge Task
You’ve mastered how to control an LED’s on/off state. Now try modifying the Task 2 program to make the LED blink continuously!
Tip: For continuous on/off, put the LED on-then-off program into forever . The reference code is as follows:

















