I used the timer_full sketch which is one of the examples from the arduino-timer lib
It faulted on the bolded statement below:
/*
* timer_full
*
* Full example using the arduino-timer library.
* - Setting a different number of tasks with microsecond resolution
* - disabling a repeated function
* - running a function after a delay
* - cancelling a task
*
*/
#include <arduino-timer.h>
****auto timer = timer_create_default()**;** // create a timer with default settings
Timer<> default_timer; // save as above
Alternatives for arduino-timer.h: []
ResolveLibrary(arduino-timer.h)
-> candidates: []
C:\Users\jgmor\OneDrive\Documents\Microcontroller Hardware and Software\Arduino\Anemometer\timer_full\Using%20Clock%20only%20Failed_copy_20220411120655\Using%20Clock%20only%20Failed_copy_20220411120655.ino:14:10: fatal error: arduino-timer.h: No such file or directory
compilation terminated.
Compilation error: exit status 1
I also have your header files, and I thought that I need the arduino-timer.cpp file that contains the code like my other libraries.
Whilst there is a convention that both .h and .cpp files must be used in a C++ library they do not have to be. It is sufficient for there to be just a .h file and for all of the library code to be in it, not just declarations of variables and functions
I think so, in that we are distilling the problem down to something more simple and thus easier to troubleshoot.
This proves that none of the code from the more complex sketch is related to the error. So we don't need to think about any of that. We know for certain that here is nothing wrong with the bare minimum part of the sketch code:
void setup() {}
void loop() {}
Please do this:
Select File > Preferences from the Arduino IDE menus.
Select and copy the contents of the "Sketchbook location" field
Press Ctrl+A to select all the text.
Press Ctrl+C.
This will copy the selected text to the clipboard.
Use Ctrl+V to paste the copied output to a reply here.
Libraries must be saved to the libraries subfolder of the path specified by the "Sketchbook location" preference.
So in your case the "arduino-timer" library would need to be installed here in order for the Arduino build system to find it while compiling your sketch:
c:\Users\jgmor\OneDrive\Documents\Microcontroller Hardware and Software\Arduino\Anemometer\libraries\arduino-timer
But from the screenshot you shared, I can see that the library is in a different location:
c:\Users\jgmor\OneDrive\Documents\Microcontroller Hardware and Software\Arduino\libraries\arduino-timer
So if you want to keep your current "Sketchbook location" setting, you should reinstall the library. I'll provide you with instructions for doing that:
Select File > Quit from the Arduino IDE menus if it is running.
Start the Arduino IDE. ⓘ This restart is needed due to a bug in the beta phase Arduino IDE 2.x (which I can tell you are using from the output): arduino/arduino-ide#796
Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view.
Click on the "Filter your search..." field.
Enter the following text: arduino-timer
You should see "arduino-timer by Michael Contreras" in the "Library Manager" search results. Click on it.
You will also need to reinstall any other libraries you installed before changing your "Sketchbook location" preference (and even any you installed during the session after changing the preference due to arduino/arduino-ide#796).
Still trying to get my head around the file Arduino file schema.
Please confirm my understanding below:
Set the sketchbook location to the folder that contains the library folder:
c:\Users\jgmor\OneDrive\Documents\Microcontroller Hardware and Software\Arduino
This folder contains the library folder.
I then saved as a sketch that compiled/uploaded/ran, to the folder, Anemometer
Jim 5, that was under the previous Aucrino folder. This sketch required no #include command.
This sketch failed to recognize the commands/function that are non-C++, arduino functions/commands as shown below:
Serial.begin(9600);// Open serial communications
^~~~~~
pinMode(AnmCnt,INPUT); // Set Anemometer contact to AnmCnt
^~~~~
pinMode(AnmCnt,INPUT); // Set Anemometer contact to AnmCnt
^~~~~~~
delay
Serial.println(AnmPls)
I think these commands need the Arduino library access because they are not standard C++ functions. This is conjecture only. Is this right?
2 in order to use the folders to organize sketches in arduino/anenometer and arduino/raingauge, I need to first create these folders (file explorer), close the ide, then move the folder under arduino to these folders.
I don't have enough information to be able to determine the cause. Please put the entire "Anemometer Jim 5" (or whatever it is) folder in a ZIP file and attach it in a reply here.
It is not really clear to me what you are asking, but you certainly are not required to use Windows File Explorer. You can create folders and save sketches anywhere you like via "File > Save as..." in the Arduino IDE. In fact, I would recommend you to use that rather than messing with the sketch folders directly because it will make it more likely that the sketch is saved in the correct format (the sketch is a folder, not a file, and the folder must contain a .ino file matching the folder name).
They are very helpful in describing the file structure necessary for Arduino. They would be very useful to me since I am struggling with communicating my proposed file structure in my narritive.
Effectively describing file system structures in text is the sort of subject I find very interesting. I spent some time considering various approaches and have settled on the format you see in my previous reply.
This is the output from the tree tool:
Installation
Windows
There is a native Windows version (tree.com) but I don't like the way it lists files as much as the Linux version. Fortunately, you can get that version for Windows as well. I sourced it here:
Linux
You should be able to get it from any package manager. I use "APT" after finding that the security sandboxing imposed by "SnapCraft" on that package interfered with my ability to use tree as I needed.
apt install tree
macOS
I haven't tried it, but I see there is a "Homebrew" formulae, which would likely be the preferred installation approach if it is not pre-installed:
brew install tree
Usage
I use it like this:
tree -AF <path>/
-A flag
The reason I use the -A flag is to ensure the nicer folder structure indicator characters. Without it, the output looks like this:
Unfortunately, you might find that the command shell ("cmd" or "PowerShell") can not properly output the ANSI lines produced by -A. I recommend using "Git Bash", which is part of the "Git For Windows" installation:
-F flag
The reason I use the -F flag is to differentiate empty folders from files:
$ tree -A foo
foo
├── bar
│ └── bar-file.txt
├── empty
└── foo-file.txt
is empty a folder or a file?
$ tree -A -F foo
foo
├── bar/
│ └── bar-file.txt
├── empty/
└── foo-file.txt
all is clear!
Trailing /
The reason I use the trailing / on the path argument is for consistency with the trailing / added to the subfolders by the -F flag:
$ tree -A -F foo/
foo/
├── bar/
│ └── bar-file.txt
├── empty/
└── foo-file.txt
Using your recommendation and explanation of the "TREE" command. I took relevant sections from my directory that include 6 more projects that are not shown.