I got a xiao arduino module and am learning how to use it.
I can get my program running from various google/github sources, but i would like to explore deeper.
unlike my familiar msvs project, which one can find his way around by combing through header files, or Intelligent code completion in IDE, arduino's IDE 2.0 doesn't give any suggestion as i typed, and there is no header files in the sketch.
Any pointer on how to find out the list of members of structure/class and available resources, interrupt service routine, etc in sketch? thanksļ¼
Obviously, ADC_AVGCTRL_SAMPLENUM_1024 is a predefined symbol, there may be other options that I could use, so I search c drive with grepWin utility, but I found nothing obviously.
ADC_AVGCTRL_SAMPLENUM_1024 is defined in a number of files named adc.h in a number of folders, for instance C:\Users\Bob2\AppData\Local_original Arduino15\packages\arduino\hardware\samd\1.8.11\bootloaders\sofia\Bootloader_D21_Sofia_V2.1\src\ASF\sam0\utils\cmsis\samd21\include\component\adc.h
For completeness here is its definition in that file
Because it exposes some low level code that beginners might find overwhelming or distracting, the IDE does not automatically provide suggestions as you type. If that is what you want, simply do this:
Select File > Preferences... from the Arduino IDE menus.
Check the box next to "ā Editor Quick Suggestions".
Click the OK button.
You also have the option of triggering suggestions on demand by using the "Trigger Suggest" keyboard shortcut (defaults to Ctrl+Space). You can customize the shortcut keys via File > Advanced > Keyboard Shortcuts.
You also might find the new "go to" features very useful for exploring the underlying code behind your sketch. Just right click on any code in the Arduino IDE editor and then select "Go to definition" or Peek > Peek definition from the context menu (depending on whether you want it to open in a new tab or inline in your current editor tab. You can also use the customizable keyboard shortcut for this.
There is a hidden one. Before compilation, this line is added to the primary .ino file of your sketch if it doesn't contain it already:
#include <Arduino.h>
You can also use the "go to" features on #include directives, so you might like to add this line to your sketch.
THanks for more pointers! it helps a lot to understand arduino
I successfully added #include <Arduino.h> but i can't add #include <adc.h>, the compiler complained " No such file or directory", but I did confirm ADC_AVGCTRL_SAMPLENUM_1024 is from one of the adc.h files, as suggested by UKHeliBob
so that i can find out which adc.h is being use in different sketch (i find six different adc.h files on my pc) and use "go to" to reveal what control i have on my adc
Just noticed you are an arduino guru, could you take a look at this possible arduino bug I ran into when you have free time? ( (I already have work around, so no rush)
the arduino module i used was called xiao, and i found ADC_AVGCTRL_SAMPLENUM_1024 from the following header files, that's why I would like to be able to add "include adc.h" to the sketch and use "go to" feature