I am having problem loading i2c_t3 library

Status
Not open for further replies.

nicnut

Well-known member
Hi everyone.

I have some code using the i2c_t3 library. I tried running the code and got some error messages including "I2C_MASTER was not declared in this scope". Then, in Arduino software, I went to examples and tried a few of the i2c_t3 examples and none of them worked.

I am on a Mac, OS 10.13.6. I searched for i2c_t3 and I didn't find anything. So I googled it, found a github link, downloaded it and put the folder in the folder where I keep all my Arduino libraries. I tried running the example code and my code and still it didn't work.

Then I deleted Arduino software and Teensyduino and reinstalled them both. Still nothing worked. When I do a search for i2c_t3 on my computer all I see is the version I downloaded. I can't find the version that comes with Teensyduino.

So how can I get this code to work? and Where is i2c_t3 library for Teensy stored on a Mac when you install Teensyduino? If you have any ideas of what I can try please let me know.

Thanks.

Nick

EDIT: I found the i2c_t3 library in the Arduino software folder, along with the examples. I am still getting error messages when I try and verify the code.

When verifying the "advanced loopback" example I get thiese errors:
Code:
Arduino: 1.8.13 (Mac OS X), TD: 1.53, Board: "Teensy 4.1, Serial + MIDI, 600 MHz, Faster, US English"











advanced_loopback:43: error: variable or field 'printStatus' declared void
 void printStatus(i2c_status status);
                  ^
advanced_loopback:43: error: 'i2c_status' was not declared in this scope
advanced_loopback: In function 'void setup()':
advanced_loopback:78: error: 'Wire' was not declared in this scope
     Wire.begin(I2C_MASTER, 0x00, WIRE_PINS, I2C_PULLUP_EXT, 400000);
     ^
advanced_loopback:78: error: 'I2C_MASTER' was not declared in this scope
     Wire.begin(I2C_MASTER, 0x00, WIRE_PINS, I2C_PULLUP_EXT, 400000);
                ^
advanced_loopback:23: error: 'I2C_PINS_18_19' was not declared in this scope
 #define WIRE_PINS   I2C_PINS_18_19
                     ^
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/i2c_t3/examples/advanced_loopback/advanced_loopback.ino:78:34: note: in expansion of macro 'WIRE_PINS'
     Wire.begin(I2C_MASTER, 0x00, WIRE_PINS, I2C_PULLUP_EXT, 400000);
                                  ^
advanced_loopback:78: error: 'I2C_PULLUP_EXT' was not declared in this scope
     Wire.begin(I2C_MASTER, 0x00, WIRE_PINS, I2C_PULLUP_EXT, 400000);
                                             ^
advanced_loopback: In function 'void rwSlave(uint8_t)':
advanced_loopback:147: error: 'Wire' was not declared in this scope
     Wire.beginTransmission(target);         // slave addr
     ^
advanced_loopback: In function 'void printWireStatus()':
advanced_loopback:221: error: 'Wire' was not declared in this scope
 void printWireStatus(void) { printStatus(Wire.status()); }
                                          ^
advanced_loopback:221: error: 'printStatus' was not declared in this scope
 void printWireStatus(void) { printStatus(Wire.status()); }
                                                       ^
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/i2c_t3/examples/advanced_loopback/advanced_loopback.ino: At global scope:
advanced_loopback:231: error: variable or field 'printStatus' declared void
 void printStatus(i2c_status status)
                  ^
advanced_loopback:231: error: 'i2c_status' was not declared in this scope
Multiple libraries were found for "i2c_t3.h"
 Used: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/i2c_t3
 Not used: /sequences/Arduino/libraries/i2c_t3-master
variable or field 'printStatus' declared void
/Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/i2c_t3/examples/advanced_loopback/advanced_loopback.ino


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
 
Last edited by a moderator:
I could be wrong, but the last time I looked this library was not yet supported on a Teensy 4.x

The last post from him (@nox771) on that was back near the end of 2019 and his last changes to the library were back in 2018.
 
Hey KurtE,

Yes you might be right. When I changed board type to Teensy 3.6 the code verified.
Is there a way that I can update the library for use on a 4.1? It might be hard for me to switch at this point in my project.
 
Sorry,

I am not much of an I2C person so I normally just use Wire library when I need I2C support. It would be probably easy to get most of the Master mode support in, but would take someone who plays a lot with the slave mode code to know how to change it.

so the real question is how much of the functionality differences of this library versus the Wire library do you need? Again so far only have seen the error messages and not the source code so hard to know how big of a job that would be.
 
Status
Not open for further replies.
Back
Top