Compiling arduino

Do I assume correctly, that if you bury a library so deep in the file structure that the the compiler cant find it, how can it compile?
I have been trying to find a library wire.h.

Why is it so hard to find this library that helps me I2C communications?

the Wire library is always bundled with the platform (boards package)

Hi @hdmadsen. Try this:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Check the box next to "Show verbose output during: ☐ compilation".
  3. Click the OK button.
  4. Open any sketch that uses the "Wire" library.
  5. Select Sketch > Verify/Compile from the Arduino IDE menus.
  6. Wait for the compilation to finish.

Now examine the contents of the black output panel at the bottom of the Arduino IDE window. There you will see the location of the Wire library that was used when compiling your sketch.

For example, when I compile this sketch for the Arduino Uno board:

#include <Wire.h>
void setup() {}
void loop() {}

I get this output:

Using library Wire at version 1.0 in folder: C:\Users\per\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire 

As Juraj explained, the "Wire" library is a "platform bundled" library, so a different variant of the library may be used when compiling a sketch from one board to another. For example, if I compile that same sketch for the Nano 33 IoT:

Using library Wire at version 1.0 in folder: C:\Users\per\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\libraries\Wire 

Please note that the filename of the "Wire" library's primary header file is Wire.h, not wire.h.

thank you so much for your information. I have used steppers, I have used servo. It just is so frustrating not to have a wire.h library to grab. I understand that the I2C comm is complicated.

Is it possible to send me a wire.h library that would work with a accelerometer?

Keep it simple and stupid firstly.
Follow the example code that comes with the library or
run some tutorials for the hardware selected.

You do have it. Just follow the instructions in my previous reply. If you have any questions or problems when following those instructions, just ask and I'll provide assistance.

I'll repeat: the filename is Wire.h, not wire.h. Note the different case of the "W". It might seem like I'm being pedantic, but there is filename case sensitivity in some cases (even when using Windows, which normally is case insensitive), so it is very important that you pay attention to this detail.

There is no point. You already have the "Wire" library installed on your computer. It is installed in a special way that allows Arduino IDE to always use the appropriate variant of the library for the board you are compiling for. It would cause a lot of problems if you installed a random Wire library because the IDE might then use it when compiling for a board that library wasn't written for.

tHANK yOU

You are welcome. I'm glad if I was able to be of assistance.

Regards,
Per

I am a 72 year old grandpa. You dont know me, but you were the only one that answered, that helped me compill.
If you will give me your address, there will be a twenty in it for helping me.

1 Like

I very much appreciate the offer, but knowing that I was able to help you in some small way is plenty enough of a reward for me already.

If you are interested in supporting the work Arduino does to make embedded systems accessible to everyone, you can consider contributing in either of the following ways:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.