Hi
i have connected my BME280 sensor through I2C comunication but after a long time of running i couln't receive any data
I uploaded the I2C scanner code
// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26 2013
// V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
// by Arduino.cc user Krodal.
// Changes by louarnold removed.
// Scanning addresses changed from 0...127 to 1...119,
// according to the i2c scanner by Nick Gammon
// https://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
// As version 4, but address scans now to 127.
// A sensor seems to use address 120.
// Version 6, November 27, 2015.
// Added waiting for the Leonardo serial communication.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(9600);
while (!Serial); // Leonardo: wait for serial monitor
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknown error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}
and i after many errors "espcomm_upload_mem failed" I made it...
the monitor prints:
15:09:04.564 -> Scanning...
15:09:04.564 -> I2C device found at address 0x07 !
15:09:04.598 -> Unknown error at address 0x08
15:09:04.631 -> Unknown error at address 0x09
15:09:04.667 -> Unknown error at address 0x0A
15:09:04.699 -> I2C device found at address 0x11 !
15:09:04.734 -> I2C device found at address 0x19 !
15:09:04.769 -> I2C device found at address 0x21 !
15:09:04.803 -> I2C device found at address 0x29 !
15:09:04.871 -> Unknown error at address 0x32
15:09:04.905 -> I2C device found at address 0x3B !
15:09:04.940 -> Unknown error at address 0x44
15:09:04.975 -> I2C device found at address 0x4C !
15:09:05.008 -> I2C device found at address 0x54 !
15:09:05.043 -> I2C device found at address 0x5D !
15:09:05.077 -> Unknown error at address 0x66
15:09:05.111 -> I2C device found at address 0x70 !
15:09:05.145 -> Unknown error at address 0x7A
15:09:05.180 -> done
i also have an arduino uno and works great but nodemcu stuck...
i also tried to flash the nodemcu but nithing happend
Any solution???