Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I use "Wire.h" library ? #64

Closed
EdXian opened this issue Jan 25, 2018 · 5 comments
Closed

How do I use "Wire.h" library ? #64

EdXian opened this issue Jan 25, 2018 · 5 comments

Comments

@EdXian
Copy link

EdXian commented Jan 25, 2018

Hi team ,
I want to include Wire.h library to my code . I find there are some definition in I2Cdev.cpp and I try to change the definition as following:

#define I2CDEV_IMPLEMENTATION       I2CDEV_ARDUINO_WIRE
//#define I2CDEV_IMPLEMENTATION       I2CDEV_BUILTIN_FASTWIRE

and then include "Arduino.h" and "Wire.h" to my code:

#include "Arduino.h"
#include "Wire.h"
void setup() {
}

void loop() {
 
}

However , the compiler still cant find "Wire.h" .
Any Idea?
Thanks in advance .

@EdXian EdXian changed the title How do I use I2C library ? How do I use "Wire.h" library ? Jan 25, 2018
@OpusK
Copy link
Contributor

OpusK commented Jan 26, 2018

Hi, @EdXian

Wire.h is not yet implemented.
Therefore, it can not be used even if the corresponding Define is used.
And the error is that there is no Wire.h in the board package. (Because it's not implemented yet)

I will discuss with the team about Wire.h support.

@EdXian
Copy link
Author

EdXian commented Jan 26, 2018

Hi @OpusK ,
Thank you for your help!
I will use the library i2Cdev directly . Can you give me some example about I2Cdev?
Thanks again.

@OpusK
Copy link
Contributor

OpusK commented Jan 26, 2018

There are no official examples using I2CDev.
I will check to see if there is an internally implemented source.

@EdXian
Copy link
Author

EdXian commented Jan 26, 2018

HI @OpusK ,
Ok , now I am trying to use the opencr board to get information from px4flow module through i2c protocol. If I test successfully , I will tell you.
Thanks again!

@OpusK
Copy link
Contributor

OpusK commented Jan 26, 2018

Hi, @EdXian

It is not an example of OpenCR, but there is two examples using I2CDev to links below.

I think it is some useful reference about how to use the API of I2CDev.

@OpusK OpusK closed this as completed Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants