Pages: [1]   Go Down
Author Topic: [Solved] Problem with wire.h when using custom libs.  (Read 1017 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I give up!  smiley-cry I need help now. Please help me why im gettings these errors. Im new here smiley
Its a library for getting sensor values from a MPU6050 6 DOF.

project.ino
Code:
#include "IMU.h"
IMU imuController;

void setup() {
  imuController.init();
...

IMU.h
Code:
#include "Wire.h"
#include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h"
class IMU {
public:
IMU();
...

MPU6050_6Axis_MotionApps20.h
https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/MPU6050_6Axis_MotionApps20.h

I2C_Dev
https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/I2Cdev
errors:
Code:
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readBytes(uint8_t, uint8_t, uint8_t, uint8_t*, uint16_t)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:278: error: 'class TwoWire' has no member named 'write'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:284: error: 'class TwoWire' has no member named 'read'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:418: error: 'class TwoWire' has no member named 'write'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:427: error: 'class TwoWire' has no member named 'read'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:430: error: 'class TwoWire' has no member named 'read'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp: In static member function 'static bool I2Cdev::writeBytes(uint8_t, uint8_t, uint8_t, uint8_t*)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:601: error: 'class TwoWire' has no member named 'write'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:607: error: 'class TwoWire' has no member named 'write'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp: In static member function 'static bool I2Cdev::writeWords(uint8_t, uint8_t, uint8_t, uint16_t*)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:651: error: 'class TwoWire' has no member named 'write'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:658: error: 'class TwoWire' has no member named 'write'
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/I2Cdev.cpp:659: error: 'class TwoWire' has no member named 'write'

File structure:
« Last Edit: March 27, 2013, 07:32:05 am by instard » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

changed:
Code:
#define I2CDEV_IMPLEMENTATION       I2CDEV_ARDUINO_WIRE

to
Code:
#define I2CDEV_IMPLEMENTATION       I2CDEV_ARDUINO0_WIRE

errors:
Code:









/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:24:19: error: twi.h: No such file or directory
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp: In member function 'void TwoWire::begin()':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:60: error: 'twi_init' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp: In member function 'void TwoWire::begin(uint8_t)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:65: error: 'twi_setAddress' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:66: error: 'twi_attachSlaveTxEvent' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:67: error: 'twi_attachSlaveRxEvent' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp: In member function 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:83: error: 'twi_readFrom' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp: In member function 'uint8_t TwoWire::endTransmission()':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:115: error: 'twi_writeTo' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp: In member function 'void TwoWire::send(uint8_t)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:143: error: 'twi_transmit' was not declared in this scope
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp: In member function 'void TwoWire::send(uint8_t*, uint8_t)':
/Users/user/Dropbox/Projects/Arduino/libraries/IMU/Wire.cpp:160: error: 'twi_transmit' was not declared in this scope
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 547
Posts: 45976
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is a copy, in your directory, of the Arduino core library composed of Wire.cpp and Wire.h. You need to either get rid of them and possibly break that library, or get rid of the core Wire library and possibly break other sketches.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Problem solved. Thank you smiley-grin
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can i ask how do you go about breaking the copy of the library or getting rid of it?
I was trying this stuff too and I encounter this problem,however it cant be resolved. Please help
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the same problem. Should i remove the Wire library from the Arduino's libraries folder?
Logged

Pages: [1]   Go Up
Jump to: