

At first glance, the no such file or directory error is particularly maddening because it seems to break that useful purpose rule. They do, however, serve a useful purpose by telling us something about what went wrong. We’ll show you what they are.Įrror messages can be such a pain. This is actually a pretty common problem, and there are two easy fixes that almost always work. If you’re trying to run an Arduino sketch but keep coming across the “no such file or directory” error, don’t worry. And once more, those maddening words, “no such file or directory,” stare back at you in hostile gaslighting mockery. “Nothing to worry about,” you mutter, sleep-starved and semi-delirious as you hit upload again. You hit upload, palms sweaty with anticipation to see all your hard work come to fruition. You’ve just spent three hours toiling on your next Arduino project, and FINALLY, you’re ready to give your sketch a whirl.

This makes the linker happy and allows your program to build.It’s 11 PM on a Wednesday. the program file that contains your start and loop functions). The magic thing to know is that if any of your libraries use Wire.h or SPI.h you must Include them in the main source file (i.e. It’s one of those horrible situations where you have to know the “magic” trick to make it work. I’ve had this before, it is very frustrating. The compiler kept complaining about the Wire.h and SPI.h libraries not being available. I’d added the AdaFruit libraries and at that point my program broke.

I’ve been creating a “Connected Little Boxes” driver for the BME280 environmental sensor (a personal favourite of mine). I hardly ever use them personally, I rely on people much cleverer than me to create libraries that I can use to talk to the hardware I want to use. They’re used by programs to communicate with devices over the I2C and SPI busses. The Wire.h and SPI.h Arduino libraries are kind of important.
