Skip to content

[Boards Manager] Include core examples to Examples menu #3297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mikaelpatel opened this issue Jun 6, 2015 · 7 comments
Open

[Boards Manager] Include core examples to Examples menu #3297

mikaelpatel opened this issue Jun 6, 2015 · 7 comments
Labels
Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix)

Comments

@mikaelpatel
Copy link

Examples in core libraries are automatically added to the Examples menu. Unfortunately core examples are not.

Would like to suggest a sub-menu with the core example sketches and libraries instead of a single level. Could be named after the core.

E.g.
File>Examples>CORE>Examples>.... the examples directory
File>Examples>CORE>Libraries>... the examples in the libraries directory

where CORE could be, for instance, Cosa.

Cheers!

@mikaelpatel mikaelpatel changed the title [Boards Manager] Include examples to be added to Examples menu [Boards Manager] Include core examples to Examples menu Jun 6, 2015
@ffissore ffissore added the Component: Board/Lib Manager Boards Manager or Library Manager label Jun 8, 2015
@ffissore ffissore self-assigned this Jun 8, 2015
@ffissore
Copy link
Contributor

ffissore commented Jun 8, 2015

@mikaelpatel what's a core example? the IDE looks for examples only in libraries folders and in its built-in "examples" folder

@mikaelpatel
Copy link
Author

@ffissore
Sorry about the somewhat short description. The "issue" occurs when using the new Boards Manager and installing a package/core with it (in my case Cosa). When previously installing to the Sketchbook/hardware/avr folder the Cosa/examples folder was available in the Sketchbook sub-menu. With the Boards Manager only the examples in the libraries folder are available. It would be great to allow a built-in examples folder per core (same level as libraries) i.e. per package.

@per1234
Copy link
Collaborator

per1234 commented Jul 3, 2017

@per1234 per1234 added Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix) labels Jul 4, 2017
@jpliew
Copy link

jpliew commented Sep 24, 2018

@per1234 ,
The workaround works with 2 confusions

  1. If the package has more than 1 board, the board name for the selected board from Tools ->Board will show up on the title of the example. Take this SparkFun workaround

image

The board selected was SerLCD but the examples was written for LilyPadProtoSnapPlus. Still the examples shows up on File->Examples menu.

  1. When user select Sketch->Include Library, the LilyPadProtoSnapPlus showed up as an includable library

image

but it is not a library, therefore causing user confusion.

Cheers
JP

@per1234
Copy link
Collaborator

per1234 commented Sep 27, 2018

If the package has more than 1 board, the board name for the selected board from Tools ->Board will show up on the title of the example.

Wrong. The name of the library will show up in the File > Examples menu. SparkFun just happens to have given their libraries the same names as boards:
https://github.com/sparkfun/Arduino_Boards/tree/master/sparkfun/avr/libraries

The board selected was SerLCD but the examples was written for LilyPadProtoSnapPlus. Still the examples shows up on File->Examples menu.

True. The Arduino IDE displays examples for all bundled libraries of the hardware package, regardless of which board of that package is selected. This is the very reason why SparkFun named the dummy libraries that way. I would have put all the examples under one dummy library:

libraries
|_SparkFun_Examples
   |_SparkFun_Examples.h
   |_examples
      |_LilyPadProtoSnapPlus
      |  |_LPP_01_Blink
      |  |  |_LPP_01_Blink.ino
      |  |_LPP_02_BasicColorMixing
      |  |  |_LPP_02_BasicColorMixing.ino
      |  |_etc...
      |_Qduino
         |_batteryLeveltoRGB
         |  |_batteryLeveltoRGB.ino
         |_fuelGauge
         |  |_fuelGauge.ino
         |_etc...      

I'm not convinced that board-specific examples are a common enough need that it's worth the work and maintenance burden to add that feature to the Arduino IDE but that's for someone else to decide. It seems like any confusion could be worked around with a bit of documentation, which SparkFun has done.

When user select Sketch->Include Library, the LilyPadProtoSnapPlus showed up as an includable library
...
but it is not a library, therefore causing user confusion.

Well it technically is a library, just an empty one, so this is the correct behavior. The dummy library is simply a workaround. It's undeniably a bit of a hack. This is the first time I've heard of anyone being confused by the dummy library and I think a lot of the blame in this case lies with SparkFun's vague library names.

My intention with my previous comment was more to point out that the requested feature is not a corner case. I think it would be great if Arduino added true support for example sketches bundled with hardware packages. Even after they do so, the problem of support for people using previous IDE versions will remain for some time so a slightly hacky workaround that works with all IDE versions remains valuable.

@jpliew
Copy link

jpliew commented Sep 28, 2018

@per1234 ,

I am sorry if I was not clear with my comment. Causing you to be confused by saying wrong.

If the package has more than 1 board, the board name for the selected board from Tools ->Board will show up on the title of the example. Take this SparkFun workaround.

The board selected was SerLCD but the examples was written for LilyPadProtoSnapPlus. Still the examples shows up on File->Examples menu.

These two paragraphs were meant to be read as one explanation. When I said

the board name for the selected board from Tools ->Board will show up on the title of the example.

I was referring to

Example for SparkFun SerLCD

Anyway, if you have not heard of anyone get confused, doesn't mean that no one is confused. The world is so big. Arduino is the most used product at school, anyway we can do to minimized confusion should be WELCOME.

Board specific examples is definitely something useful, it may not be for you, but does not mean others will not be beneficial.

Good luck.

@jpliew
Copy link

jpliew commented Sep 28, 2018

@per1234

I would have put all the examples under one dummy library:

libraries
|_SparkFun_Examples
   |_SparkFun_Examples.h
   |_examples
      |_LilyPadProtoSnapPlus
      |  |_LPP_01_Blink
      |  |  |_LPP_01_Blink.ino
      |  |_LPP_02_BasicColorMixing
      |  |  |_LPP_02_BasicColorMixing.ino
      |  |_etc...
      |_Qduino
         |_batteryLeveltoRGB
         |  |_batteryLeveltoRGB.ino
         |_fuelGauge
         |  |_fuelGauge.ino
         |_etc...      

Even if someone does the above suggestion, the title of the example will still be called

Examples for xxxxx

where xxxxx is the selected board. So this suggestion is technically still confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

No branches or pull requests

4 participants