Wire library..

Hi All,
A silly question! But where can I find and download the Wire library?? I had it, because my sketch used it via the I2CIO lib, but it seems to have vanished. Looked in the 2 places that have lib folders.

The Arduino site gives lots of info on the libraries, but not how to download them all, or are my eyes really getting that bad??

Any help and comments very welcome..



P.S. You've got one cool website, sir!

The Wire library comes with the IDE. It should be in the libraries folder in the IDE instalation folder (not sketchbook). If it is not there, maybe reinstall the IDE?


@PB Thanks for the link, I got it! Thanks glad you liked the website, really must do a bit more work on it.

@GF A good tip reinstalling the IDE got the Wire.lib back on the system.

But I still get an error on compiling, this:

‣ Wire [C:\Users\Mel\Documents\Arduino\libraries\Wire]
◦ Wire.cpp
• Error at line 30 in file Wire.cpp:
‣ twi.h: No such file or directory

Compiling Failed

That seems to say that twi.h is missing, would it not be a part of Wire.h? not one i've heard of.... Any ideas!

Thanks to all, in that case I was using Uecide IDE.


The twi.h file should also be installed with the IDE. The twi is the 2 wire serial interface that the Wire library is based on (section 21 of the 328 data sheet).

In my installation (of 1.6.7), it is in 3 places.
and ...arduino-1.6.7\hardware\arduino\avr\libraries\Wire\utility.

Will the program compile with the Arduino IDE?

Hi GF,
How are we expected to find it there, let along the IDE! I have found it in the same locations as you. I added it to both my library and the one under c;/prog files/arduino etc...

But now I get this problem when I try to compile it:

‣ Wire [C:\Users\Mel\Documents\Arduino\libraries\Wire]

◦ Wire.cpp
• Error at line 30 in file Wire.cpp:
‣ twi.h: No such file or directory

 #include "twi.h"
compilation terminated.
Compiling Failed[code]  

So is there an error in the Wire.h file, or is it just not finding twi.h? it seems to be the later, so where whould you put it?  The problem is the same if I use the Arduino IDE or Uecide.



The Wire library should not be in the libraries folder of your sketchbook. None of the libraries that are installed with the IDE should be there. I don't know if that is the problem, but it is not right. On my system, the Wire library for ver 1.6.7 is at ...\arduino-1.6.7\hardware\arduino\avr\libraries\Wire, only.

Is that the whole error message? What version of the IDE are you working with?

Hi GF,
Sorry for the delay! but I've spent some time sorting my Libraries out, I kept getting warnings of dulicated library files. Also reinstalled the latest version of the IDE 1.8.2. and glad to say things are back to normal and that code now compiles and uploads OK.

Thanks to all for your help and advice, regards.


Glad to hear you got it going.

The newer IDEs will now determine include paths for library code header files based on looking in the library code.
The older IDEs did not do this an only determined include paths based on inlcuded headers in the sketch.
The old way didn't allow a library to use a library unless the sketch included a header file for the sub library.
The new IDE works the way the IDE should have worked all along.

I'm guessing that the issue you were having was related to this.

--- bill