A complete I2C control tutorial for the youyeetoo K1, including a control example for the BME280 temperature/humidity/barometric pressure sensor module
I.Hardware Interface Description:
The board provides one I2C3 interface. The connector pinout is as follows:




Module Pin Description:
| Module Pin | Description |
|---|---|
| 5V | Power supply positive |
| GND | Ground |
| SCL | I2C/SPI serial clock line |
| SDA | I2C serial data line |
| 3-wire SPI serial data input/output port | |
| 4-wire SPI serial data input | |
| CSB | Chip select pin. High level (default) selects the I2C interface |
| Low level selects the SPI interface | |
| SDO | I2C address select bit; 4-wire SPI serial output port |
Example Wiring Scheme:
BME280 Module youyeetoo K1 Development Board
1.25 mm pitch 4-pin connector
VCC ─────────────────→ 3.3V
GND ─────────────────→ GND
SCL ─────────────────→ SCL
SDA ─────────────────→ SDA
CSB ─────────────────→ (Optional)
SDO ─────────────────→ (Optional)

This tutorial uses the BME280 module (operating voltage 3.3 V). It is a small-package, low-power digital composite sensor based on APSM process technology that can measure ambient temperature, humidity and barometric pressure. The humidity-sensing element features fast wake-up and response time, high accuracy and a wide operating temperature range;
the pressure-sensing element is a piezoresistive, low-noise, high-precision and high-resolution absolute barometric pressure sensing element; and the temperature-sensing element features low noise and high resolution, allowing the temperature value to be used for temperature compensation and self-calibration of the humidity and pressure readings.
The humidity-sensing element and the pressure-sensing element can be enabled/disabled independently via the oversampling configuration registers, so the sampling rate of each sensing element can be configured. This makes the module well suited to space-constrained mobile devices such as smartphones, tablets, smart watches and wearables, as well as weather forecasting, vertical velocity indication, fee-control devices, indoor and outdoor navigation, and smart home devices.
Temperature detection range:0℃~+65℃
Temperature measurement error:±0.5℃ MAX ±1℃;resolution 0.1℃
Relative humidity measurement range:0~100%,humidity response time:greater than 1s
Relative humidity measurement error:±2%; humidity hysteresis:±1%;resolution 0.8%
Pressure measurement range:300~1100hPa
Pressure measurement error:±1hPa resolution 0.18Pa
Digital interface type:IIC(slave mode, 3.4 MHz)or SPI (3-wire or 4-wire slave mode, 10 MHz)

In I2C mode, the device address of the module is determined by the SDO pin. When SDO is tied to GND (low level) the slave address is 0x76 — the default for this module; when tied to high level the slave address is 0x77.
Test environment used for this tutorial:
Permission requirements:
Note: Other Linux distributions should work in theory, but have not been tested.
Note: Internet connection required for download and installation
Install the necessary build tools:
# Update the package list (requires internet)
sudo apt update
# Install compilation toolchain (includes gcc, g++, make, etc.)
sudo apt install build-essential
Verify the installation:
# Check the gcc version
gcc --version
# Check the make version
make --version
# Extract the archive
test@test-K1-SBC:~$ unzip K1-IIC-Package.zip
Archive: K1-IIC-Package.zip
inflating: fhl-api_1.0.0_amd64.deb
inflating: Installation.txt
inflating: bme280_linux.c
inflating: Makefile
# Install the FHLAPI support package
sudo dpkg -i fhl-api_1.0.0_amd64.deb
# Compile the executable
test@test-K1-SBC:~$ make
gcc -Wall -O2 -o bme280_linux bme280_linux.c -lm
=========================================
Build successful!
=========================================
Run: sudo ./bme280_linux
A successful build produces:
bme280_linux - the Linux program that controls the BME280test@test-K1-SBC:~$ sudo ./bme280_linux
[sudo] password for test:
========================================
BME280 Sensor Reader (Linux I2C)
========================================
Opening I2C device: /dev/i2c-3
Trying I2C address 0x76...
BME280 found at 0x76 (Chip ID: 0x60)
Reading calibration data...
Calibration loaded
Configuring sensor...
Sensor configured
Reading data (Press Ctrl+C to exit):
========================================
[16:35:15] Reading #1
Temperature: 25.18 °C | 77.32 °F
Pressure: 1012.22 hPa | 101221.70 Pa
Humidity: 43.69 %
Calculated:
Altitude: 8.61 m (ref: 1013.25 hPa)
Dew Point: 11.94 °C | 53.50 °F
Heat Index: 25.18 °C | 77.32 °F
Sea Level: 1012.22 hPa
[16:35:16] Reading #2
Temperature: 25.16 °C | 77.29 °F
Pressure: 1012.27 hPa | 101226.88 Pa
Humidity: 43.70 %
Calculated:
Altitude: 8.17 m (ref: 1013.25 hPa)
Dew Point: 11.93 °C | 53.47 °F
Heat Index: 25.16 °C | 77.29 °F
Sea Level: 1012.27 hPa
[16:35:17] Reading #3
Temperature: 25.17 °C | 77.31 °F
Pressure: 1012.19 hPa | 101219.21 Pa
Humidity: 43.70 %
Calculated:
Altitude: 8.81 m (ref: 1013.25 hPa)
Dew Point: 11.94 °C | 53.49 °F
Heat Index: 25.17 °C | 77.31 °F
Sea Level: 1012.19 hPa
#Press Ctrl + C to stop the program while it is running
Shutting down...
Sensor closed. Goodbye!