This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:iot-open:practical:hardware:sut:esp32:emb1b_1 [2025/04/25 12:10] – pczekalski | en: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); |