Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:iot-open:practical:hardware:sut:esp32:emb1b_1 [2025/04/25 12:08] pczekalskien:iot-open:practical:hardware:sut:esp32:emb1b_1 [2025/04/28 20:32] (current) – [Steps] pczekalski
Line 49: Line 49:
 Declare BME's address, sensor controller class and variables to store readings: Declare BME's address, sensor controller class and variables to store readings:
 <code c> <code c>
 +#define SCL 4
 +#define SDA 5
 +
 static const int BME280_addr = 0x76; //I2C address static const int BME280_addr = 0x76; //I2C address
  
Line 63: Line 66:
 Initialise the I2C bus and the controller class: Initialise the I2C bus and the controller class:
 <code c> <code c>
-Wire.begin(5,4); //5 (SDA),  4 (SCL+Wire.begin(SDA,SCL);  
 +delay(100);
 ... ...
 isBMEOk = bme280.begin(BME280_addr); isBMEOk = bme280.begin(BME280_addr);
Line 69: Line 73:
 If ''begin'' returns ''false'', then initialisation failed. This may be due to an invalid I2C address provided as a parameter of the ''begin'' function, a broken sensor, or broken connections between the MCU and the sensor. If ''begin'' returns ''false'', then initialisation failed. This may be due to an invalid I2C address provided as a parameter of the ''begin'' function, a broken sensor, or broken connections between the MCU and the sensor.
  
 +<note important>You need to initialise the I2C bus only once. If you're using other I2C devices in parallel, do not call ''Wire.begin(...)'' multiple times.</note>
 === Step 4 === === Step 4 ===
 Read environmental data (one at a time): Read environmental data (one at a time):
en/iot-open/practical/hardware/sut/esp32/emb1b_1.1745582925.txt.gz · Last modified: 2025/04/25 12:08 by pczekalski
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0