Library generator

Care to share the PHP code? I would like to extend it a little bit :slight_smile: (like doxygen code etc) :slight_smile:

Nice I would love to make my own too.
I am working on stepper motor

I could do, but it's a little messy :wink:

I know... I'll clean it up and github it - that way anyone could contribute.

Great!! thanks
Nico

Ok, it's a bit cleaner. There's enhancements I'd like to make too, like breaking out the actual template data from the code (it's embedded at the moment - quick'n'dirty :wink: ).

Feel free to fork, clone, edit, commit, push, and generate pull requests to your heart's content.

Oh, and I have just split the template data out from the script into template files. Much more elegant I feel - easier to edit and extend the template.

Java isn't bad in itself, but it has enabled morons to write programs.

So did visual basic and does php. 8)
karma +1 for daring to share this opinion.
Best regards
Jantje

Jantje:

Java isn't bad in itself, but it has enabled morons to write programs.

So did visual basic and does php. 8)
karma +1 for daring to share this opinion.
Best regards
Jantje

It's not an opinion... : ]:smiley:

PHP is great for quick'n'dirty scripting work, as you can see by my code :wink: It's also, like Java, incredibly powerful in the right hands. I wouldn't choose PHP to write a desktop application, and I wouldn't choose Java to write a web application. Come to that I wouldn't choose Java to write anything really, but it's often what you're stuck with when you're working with someone else's code...

And let's not even mention Visual Basic...

Works like a charm. What I want to do is:

  • add a bunch of doxygen parms I am working with
  • add a couple of SVN parameters
  • add the ability to work both under Arduino and Eclipse without source modifcation
  • and any other nice to have stuff :slight_smile:
    But that does need some changes in the files and I am not sure the author likes it that way :grin: But of course I am always willing to share. Ia

nicoverduin:
...

  • add the ability to work both under Arduino and Eclipse without source modifcation

What is needed for this?
Best regards
Jantje

Hi Jantje
For Eclipse we include the .h file with the references to setup and loop and any functions we use. Which btw is neat programming as far as I am concerned :slight_smile:
In the Arduino we can skip all this.
And a couple of my customers just want the sketch and that's it. So now I solve it this way:

#ifdef __IN_ECLIPSE__
#include "test.h"
#endif

Then it always works

nicoverduin:
Works like a charm. What I want to do is:

  • add a bunch of doxygen parms I am working with
  • add a couple of SVN parameters
  • add the ability to work both under Arduino and Eclipse without source modifcation
  • and any other nice to have stuff :slight_smile:
    But that does need some changes in the files and I am not sure the author likes it that way :grin: But of course I am always willing to share. Ia

It's under the BSD license - you can copy / modify / redistribute at will as long as you keep it under the same license :wink:

If you do come up with some nice generic mods that would be useful for others, then it would be great if you could share them back to the original repo.

When I am finishied playing around, I put it back in GITHUB and let you decide if you want to commit.
Regards
Nico

The way it's normally done is you fork the repo (press the "fork" button in the top right) then you have a copy of it on GitHub. Then you clone your repo to your local computer, and do all your work in there. Then you can check it in and push to your own repo as much as you like.

When you're happy with it you create a pull request (green button) which then generates a patch which I can apply to my repo automatically.

nicoverduin:
Hi Jantje
For Eclipse we include the .h file with the references to setup and loop and any functions we use. Which btw is neat programming as far as I am concerned :slight_smile:
In the Arduino we can skip all this.
And a couple of my customers just want the sketch and that's it. So now I solve it this way:

#ifdef __IN_ECLIPSE__

#include "test.h"
#endif



Then it always works

I'm a bit confused here. IMHO Arduino does not do "pre processing" of the library files. So for libraries you are down to C/C++ including the need of function definitions before function usage.
For sketches the only file arduino includes behind your back is arduino.h. All the libraries need a include in the ino file. If not Arduino can not calculate the build and include path.
So IMHO

#ifdef __IN_ECLIPSE__
#include "test.h"
#endif

can always be replaced with

#include "test.h"

when test.h has the double include protection like

#ifndef _[HEADERNAME]_H_
#define _[HEADERNAME]_H_
//Your code goes here 
#endif

If I'm wrong please tell me.

Note that I created the IN_ECLIPSE define and I never used it. I'm not even sure V2 of the plugin still defines it.
So if there is a need I would like to know so I can make sure it stays in (or gets back into) the plugin.
Best regards
Jantje

Hi Jantje
I have customers who simply just don't want the extra include file when they compile the code. They just want the single .ino.
So if I simply put the include in, Arduino will start complaining. Doing it this way the preprocessor knows it works within either Eclipse or not.
So please leave it in :slight_smile:

You do have a point there.
You also have some demanding customers :wink:
I'll leave it in or put it back in.

Best regards
Jantje

nope :), totally ignorant to Arduino etc. II write software for all kinds of hardware solutions while I have never even seen the hardware itself :slight_smile: I just build to design specs, mail the sketch, they load it and program the hardware. Cést tout....
And they pay the bills :slight_smile:

nicoverduin:
nope :), totally ignorant to Arduino etc. II write software for all kinds of hardware solutions while I have never even seen the hardware itself :slight_smile: I just build to design specs, mail the sketch, they load it and program the hardware. Cést tout....
And they pay the bills :slight_smile:

Send them over to me if you have to much work :wink:
Back to the library generator.
Based on the discussion I see no reason for special eclipse code unless you also want to generate example frameworks.
Best regards
Jantje