I'm using a Nano 33 BLE Sense Lite. I have "Arduino Nano 33 BLE" as my board and "COM4" as my port. I am able to successfully upload an example blink (from file --> examples --> basics --> blink), but when I try to upload (from file --> examples --> Harvard_TinyMLx (under "examples from custom libraries") --> magic_wand), I'm getting the following error:
In file included from C:\Users\ual-laptop\AppData\Local\Temp\.arduinoIDE-unsaved2023619-15524-1m1qk0q.06h5h\magic_wand\magic_wand.ino:23:0:
C:\Users\ual-laptop\AppData\Local\Temp\.arduinoIDE-unsaved2023619-15524-1m1qk0q.06h5h\magic_wand\imu_provider.h:4:10: fatal error: Arduino_LSM9DS1.h: No such file or directory
#include <Arduino_LSM9DS1.h>
^~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: Arduino_LSM9DS1.h: No such file or directory
I tried looking this up and it says it's because I don't have a particular library installed, but if that was the case, then I shouldn't even be able to upload blink (which I was).
Edit: I'll also note that I also tried to upload hello_world (from file --> examples --> Harvard_TinyMLx (under "examples from custom libraries") --> hello_world) and person_detection (from file --> examples --> Harvard_TinyMLx (under "examples from custom libraries") --> person_detection) and I was able to upload both successfully.
Please consult the instructions for installing a library, available on this site. It's an automatic process built in to the IDE now, better than the old manual installations...
It's very likely, the guide you are using, does ask you to install a library and probably tells you how to do it. You probably just missed it - go back and look.
It does include that (on slide 7, see link edited into my original post), and I did do the process. The only difference is the version of Harvard_TinyMLx I used (but I tried both the most UTD version and the one the guide uses and the result is the same either way).
And no, they didn't have #include (so I'm guessing it means they don't require the library).
Okay, I'm getting another issue. I'm trying to run the magic wand example from Harvard_TinyMLx but I'm having issues with <TensorFlowLite.h> since it used to be a downloadable library package from arduino but not anymore. I know that now, we need to download manually from GitHub - adafruit/Adafruit_TFLite: TensorFlow light helper class for Adafruit & Arcada boards, but when I run it now, I get the following error:
C:\Users\ual-laptop\AppData\Local\Temp\.arduinoIDE-unsaved2023619-15524-1m1qk0q.06h5h\magic_wand\magic_wand.ino:15:10: fatal error: tensorflow/lite/micro/micro_error_reporter.h: No such file or directory
#include "tensorflow/lite/micro/micro_error_reporter.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: tensorflow/lite/micro/micro_error_reporter.h: No such file or directory
I'm guessing it's because the Adafruit version doesn't have directories that are the exact same name as the original tensorflowlite version but I'm also not seeing any clear equivalents. Is there a way to resolve this issue?
Hi @jkim7. I'm going to ask you to post the full verbose output from a compilation.
This procedure is not intended to solve the problem. The purpose is to gather more information.
Please do this:
Select File > Preferences... from the Arduino IDE menus.
The "Preferences" dialog will open.
Check the box next to "Show verbose output during: ☐ compilation" in the "Preferences" dialog.
Click the OK button.
Select Sketch > Verify/Compile from the Arduino IDE menus.
Wait for the compilation to fail.
You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the COPY ERROR MESSAGES button on that notification.
Open a forum reply here by clicking the Reply button.
Click the <CODE/> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press Ctrl+V.
This will paste the compilation output into the code block.
Move the cursor outside of the code tags before you add any additional text to your reply.
Click the Reply button to post the output.
In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:
Open a forum reply here by clicking the Reply button.
Click the "Upload" icon () on the post composer toolbar:
A dialog will open.
In the dialog, select the .txt file you saved.
Click the Open button.
Click the Reply button to publish the post.
Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.
Select Tools -> Manage Libraries...
In the "Filter your search..." box put LSM9DS1.
Scroll down to "Arduino LSM9DS1 Library" and click on the "INSTALL" button.
In order to fix this error, you must install the "Arduino_LSM9DS1" library. I'll provide instructions you can follow to do that:
Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
In the "Filter your search" field, type Arduino_LSM9DS1
Scroll down through the list of libraries until you see the "Arduino_LSM9DS1" entry.
You will see an "INSTALL" button at the bottom of the entry. Click the button.
Wait for the installation to finish.
We can see the explanation here:
The "Harvard_TinyMLx" library includes a bundled copy of TensorFlow Lite. This is done because the API of the TensorFlow Lite library seems to be in a state of constant change, meaning that code developed with one version of the TensorFlow Lite library will likely not work for a user who has a different version of the TensorFlow Lite library installed. By bundling the specific version of TensorFlow Lite the "Harvard_TinyMLx" library was written for, they can be sure that the user will have access to the appropriate dependency.
However, if you install a standalone copy of the TensorFlow Lite library, that can cause Arduino IDE to use that other installation of TensorFlow Lite instead of the one bundled with the "Harvard_TinyMLx" library. That is what happened to you.
If you don't have any specific need for the "Adafruit TFLite Micro Speech" library, you can solve the problem by uninstalling that library. I'll provide instructions:
Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
In the "Filter your search" field, type Adafruit TFLite Micro Speech
Scroll down through the list of libraries until you see the "Adafruit TFLite Micro Speech" entry.
Hover the mouse pointer over the "Adafruit TFLite Micro Speech" entry.
You will see a ●●● icon appear near the top right corner of the library entry. Click on that icon.
A context menu will open.
Select "Remove" from the context menu.
An "Uninstall" dialog will open.
Click the "YES" button in the "Uninstall" dialog to confirm that you want to uninstall the library.
Wait for the uninstall process to finish.
Now try compiling the "magic_wand" example sketch again.