Project 18: Bluetooth-Based Remote Page Turner

Topic Introduction–Internet of Things (IoT)


In this topic, we start learning IoT (“Internet of Things”), which extends people - to - people connections to people-things and things-things interactions via various sensing devices and advanced communication technologies. IoT’s core is data collection, transmission, and application. In short, IoT enables transmitting collected data for remote device monitoring and control, expanding works' spatial functionality.
In this phase, we start with IoT communication protocols (core communication rules) to understand IoT's functions and characteristics. Subsequently, focusing on home scenarios, we gradually build IoT systems to learn their feedback and control mechanisms and construction methods.


Project 18:Bluetooth-Based Remote Page Turner


Bluetooth, a typical communication tech, is widely used in daily life (e.g.wireless earbuds, smart bracelets connecting to phones). In this project, we’ll make a remote page turner with UNIHIKER K10’s built-in Bluetooth to remotely control computer document page turns.


Project Objectives


Knowledge Goals


1.Understand the concept of loT.
2.Learn the Bluetooth protocol and short-range communication.
3.Learn the Bluetooth features of the UNIHIKER K10.
4.Control a computer via Bluetooth using the UNIHIKER K10.


Practical Goals


Connect the UNIHIKER K10 to a computer via Bluetooth to remotely turn pages.

Materials List

HARDWARE LIST
1 UNIHIKER K10
1 USB Cable

Preparations


Hardware Connection


Connect the UNIHIKER K10 to the computer using a USB cable.

Software Preparation


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’ll practice using UNIHIKER K10’s built-in Bluetooth to remotely control computers for document page turns.


Code


Click "Extensions", select "Module", search for "ESP32 BLE Keyboard" and click to load it. Return to the command area, and you will see the relevant Bluetooth control blocks.

Next, we can complete the core code writing following the logic: BLE Keyboard initialization → continuous detection of buttons (Buttons A/B) → BLE Keyboard Comb Key, as shown in the figure below:

To better show Bluetooth connection status, we can add connection judgment and text prompts. The complete reference code is as follows.

Run the Code


Click the“Upload”button.After upload, the screen shows blank, indicating Bluetooth is not connected.
Now, we can connect the configured Bluetooth with a computer(for Windows system). Taking the Windows 11 system as an example, the specific operation steps are as follows:
Step 1: Search and open "Bluetooth and other devices settings" — your computer will auto-search for Bluetooth devices.

Step 2: Click "Add Device"→select "Bluetooth"→find the defined Bluetooth device (e.g. "BLE Keyboard")→click to pair.
If the pairing is successful, the screen of the UNIHIKER K10 will display the connection status.

Now press UNIHIKER K10’s Keys A/B for cursor up/down or PPT page turns.
Note: Second program run may have unstable connection (failed to control computer). Right-click to delete the Bluetooth device, re-add for stable connection.

Block Review

Category

Blocks

Function

Initialize the Bluetooth Keyboard function of the UNIHIKER K10, and the name can be modified as needed.
Used to determine the connection status between the Bluetooth Keyboard and the device.
Used to send specified function keys to the device via Bluetooth, with three combination keys available for selection.

Knowledge Base


Next, let's learn and summarize the knowledge used in this lesson.


What is the Internet of Things (IoT)?


Internet of Things (IoT) is a network that enables interconnection of functional devices via the Internet, traditional telecom networks, etc.
For example, in smart homes, connect lights, fans, cameras, etc. to phones via home Wi-Fi, realizing Internet of everything (IoE).
In IoT, data transmission includes traditional Internet communication and new methods for its features: massive connectivity, low power, low cost.

What is Bluetooth?


Bluetooth is a typical short-range wireless communication protocol. Most mobile phones, tablets, laptops support Bluetooth. How does Bluetooth work?


Working Principle of Bluetooth Communication


Bluetooth requires two roles for communication: master and slave. In theory, one master can connect to 7 slaves simultaneously. For example, a computer (master) can link Bluetooth headsets, mice, keyboards, etc. (slaves).

Take communication between two Bluetooth devices for example: specific process as follows.

Bluetooth Communication Technology, as a low-power and low-cost communication method, is widely used in scenarios such as smart homes and wearable devices, bringing great convenience to people's lives.


Challenge Yourself


Based on the content learned in the first phase, add more control mechanisms to your Bluetooth presenter, such as using different UNIHIKER K10 attitude control to trigger line breaks.
Tip: The sample program is as follows:

License
All Rights
Reserved
licensBg
0