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

'MbedI2C' does not name a type #39

Open
djaus2 opened this issue Mar 5, 2023 · 2 comments
Open

'MbedI2C' does not name a type #39

djaus2 opened this issue Mar 5, 2023 · 2 comments

Comments

@djaus2
Copy link

djaus2 commented Mar 5, 2023

In Acceleration detection sketch wrt MPU6050 sketch 27.1

at line 10

MbedI2C iic(6,7);

Get compilation error 'MbedI2C' does not name a type

Seems another library needs to be referenced.

@djaus2
Copy link
Author

djaus2 commented Mar 5, 2023

Found a solution:

//MbedI2C iic(6,7);
TwoWire iic(i2c1,6,7);  
//TwoWire iic(i2c0,4,5);

TwoWire is instatiated as in wire,h

TwoWire(i2c_inst_t *i2c, pin_size_t sda, pin_size_t scl);

i2c_inst_t is a struct in ic2.h that contains the following specific instance references:

In i2c.h:

typedef struct i2c_inst i2c_inst_t;

...
...

extern i2c_inst_t i2c0_inst;
extern i2c_inst_t i2c1_inst;

#define i2c0 (&i2c0_inst) ///< Identifier for I2C HW Block 0
#define i2c1 (&i2c1_inst) ///< Identifier for I2C HW Block 1
```.

@Shaynee-MO
Copy link
Member

Hi! It seemed that you are using the Raspberry Pi Pico kit, and not using the latest code.
You can download the latest one with this link:
https://github.com/Freenove/Freenove_Ultimate_Starter_Kit_for_Raspberry_Pi_Pico/archive/refs/heads/master.zip

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