I am using this programm now (same error however)
#include "bno055.h"
int counter;
void setup() {
Serial.begin(9600);
Wire.begin();
WRITE_I2C_BNO055_INIT();
counter = 0;
}
void loop() {
int data;
data = READ_I2C_BNO055_YAW();
if(data > 6000){
counter++;
}
Serial.println(data);
Serial.println(counter);
Serial.println("-----------");
yield();
}
With this library
#include <Wire.h>
void WRITE_I2C_BNO055_INIT()
{
do
{
delay(10);
Wire.beginTransmission(0x28);
Wire.write(0x00);
Wire.endTransmission(false);
Wire.requestFrom(0x28, 1, true);
} while(Wire.read() != 0xA0);
Wire.beginTransmission(0x28);
Wire.write(0x3D);
Wire.write(0x0C);
Wire.endTransmission();
}
uint16_t READ_I2C_BNO055_YAW()
{
uint16_t value = 0;
Wire.beginTransmission(0x28);
Wire.write(0x1A);
Wire.endTransmission(false);
Wire.requestFrom(0x28, 2, true);
value = (int16_t)(Wire.read()|Wire.read()<<8 )/16;
return value;
}
uint16_t READ_I2C_BNO055_ROLL()
{
uint16_t value = 0;
Wire.beginTransmission(0x28);
Wire.write(0x1C);
Wire.endTransmission(false);
Wire.requestFrom(0x28, 2, true);
value = (int16_t)(Wire.read()|Wire.read()<<8 )/16;
return value;
}
uint16_t READ_I2C_BNO055_PITCH()
{
uint16_t value = 0;
Wire.beginTransmission(0x28);
Wire.write(0x1E);
Wire.endTransmission(false);
Wire.requestFrom(0x28, 2, true);
value = (int16_t)(Wire.read()|Wire.read()<<8 )/16;
return value;
}
pylon:
Which of the two boards did you connect to the UNO? Post that wiring diagram! Did you use the same code?
I Connected the Sensor to the UNO and let exactly the same (new) program (see above) run.
The connections were:
Arduino UNO Sensor
3V3 ----------> Vin
GND ----------> GND
A4 -----------> SDA
A5 -----------> SCL
With this setup (Arduino UNO to BNO055) I got right returns and it didn't stop.
I also connected the NodeMCU to the Arduino. There the communication also worked. (with this tutorial NodeMCU I2C with Arduino IDE | NodeMCU
The connections were:
NodeMCU(Master) Arduin UNO (Slave)
GND -----------------> GND
A4 ------------------> D1
A5 ------------------> D2
pylon:
What board was selected during compilation for the NodeMCU?
The board selected during compilation was "NodeMCU (ESP-12 Module)"
I think the thing described in
dinkelberg:
I have gained a new insight: ...
yields a strong hint for solving my problem.