Hello,
I found two programs about Kalman filter. The bottom one gives "i2cWrite wac not declared in this scope " but the top one gives no fault. Can anyone explain me the reason ?
ITG3205_ADXL345.ino (4.43 KB)
Kalman_feb09a.ino (6.9 KB)
Hello,
I found two programs about Kalman filter. The bottom one gives "i2cWrite wac not declared in this scope " but the top one gives no fault. Can anyone explain me the reason ?
ITG3205_ADXL345.ino (4.43 KB)
Kalman_feb09a.ino (6.9 KB)
Please post the entire error message so that the source of the error is more obvious
One sketch calls and implements i2cWrite. One calls it but does not implement it.
One compiles. One doesn't. It's not rocket science to determine which is which, and why the other one fails to compile.
The exact message " 'i2cWrite' was not declared in this scope. I know it is compiling problem. But why ?
I use the same Wire.h file . I checked the computer there is no another Wire.h file.
i2cWrite() is not a method in the Wire library. LOOK at your code. One of the sketches defines a function called i2cWrite!
The first program has an i2cWrite() function in it.
void i2cWrite(uint8_t address, uint8_t registerAddress, uint8_t data) {
Wire.beginTransmission(address);
Wire.write(registerAddress);
Wire.write(data);
Wire.endTransmission();
}
The second one doesn't.
You are right . Sorry for carelessness :-[
It is showing me two errors in the following code like "void i2cWrite(uit8_t, unit8_t, unit8_t)" and "could not convert 'i2cWrite(107u, 1u, 1u)' from 'void to bool' ". When i was trying to compile the below code. can you please solve the error in it.
Kalman_feb09a.ino (8.84 KB)
Please post the full error messages
SunDar_ShEtty:
these two are the errors that are mentioned in the screen shoot.
Why pictures ?
Just post the error text here
while (i2cWrite(0x6B, 0x01, true)); // PLL with X axis gyroscope reference and disable sleep mode
Garbage. The i2cWrite() function does not return a value, so you can't use the non-existent value in while statement.
UKHeliBob:
Why pictures ?
Just post the error text here
UKHeliBob:
Why pictures ?
Just post the error text here
i taught it would be more transparent
PaulS:
while (i2cWrite(0x6B, 0x01, true)); // PLL with X axis gyroscope reference and disable sleep mode
Garbage. The i2cWrite() function does not return a value, so you can't use the non-existent value in while statement.
but the is is not giving me any output if i omit these two lines in the code
but the is is not giving me any output if i omit these two lines in the code
That statement is horsecrap. The Arduino isn't doing ANYTHING with code that can't even be compiled on the PC.
You need the calls to i2cWrite(), but they do NOT belong in the conditional part of a while statement.
PaulS:
That statement is horsecrap. The Arduino isn't doing ANYTHING with code that can't even be compiled on the PC.You need the calls to i2cWrite(), but they do NOT belong in the conditional part of a while statement.
thanqqq sir