- Install
- Basic operation
- Basics of programming for electronic work
- Basics of programming for Excel
- Machine learning with scikit-learn
- Visualizing data with matplotlib
- Web programming
- RPA programming
- Miscellaneous programming
- Reference
Control BMP280
You can control the temperature/pressure sensor BMP280.
Wiring
The BMP280 module and the microcontroller are connected via I2C.
The pin numbers used for I2C connection vary depending on the microcontroller.
For more information, see the "I2C connection" page.
For example, in the case of a plain ESP32, connect SDA to pin 21 and SCL to pin 22.
Initialization
For microcontrollers with fixed I2C pin numbers, such as the original ESP32, use the "Initialize BMP280" block.
![]()
Also, for microcontrollers with variable I2C pin numbers, such as the ESP32-S3, use a block that specifies the pin number during initialization.
Getting temperature and air pressure
After initialization, you can use blocks to get temperature and air pressure.
Temperature is in Celsius, and pressure is in hectopascals.
The values obtained by these blocks can be assigned to variables or output to the screen.
![]()
![]()
Example
The following example is an example of reading temperature and pressure from the BMP280 every second and outputting them to the web browser console.
This program can be downloaded from here.