Page 1 of 2
Using Arduino libraries on other C-compiler IDEs
Posted:
Wed Jun 10, 2015 5:52 pm
by helpme
I discovered the Arduino IDE for ESP8266 and likes it very much. The Arduino libraries are wonderful but I do not like the Arduino IDE. Is it possible to use the friendly Arduino libraries on other IDEs like Eclipse? I prefer my development files to be .cpp and not .ino
Re: Using Arduino libraries on other C-compiler IDEs
Posted:
Thu Jun 11, 2015 10:20 pm
by tytower
Does it matter what file ending ?
All the libraries are .cpp and .h so what you call your files shouldn't matter much ,but they will probably only run in the Arduino IDE as ino with the setup() and loop() functions in place .
Change a program file from .ino to .cpp and see what you get come up.
You could try changing setup() to main() maybe
Re: Using Arduino libraries on other C-compiler IDEs
Posted:
Thu Jun 11, 2015 11:02 pm
by helpme
tytower wrote:Does it matter what file ending ?
All the libraries are .cpp and .h so what you call your files shouldn't matter much ,but they will probably only run in the Arduino IDE as ino with the setup() and loop() functions in place .
Change a program file from .ino to .cpp and see what you get come up.
You could try changing setup() to main() maybe
The file extension doesn't matter much. But what I don't like about .ino files is that it gets huge and hard to manage when the software grows. Dividing the main software into .cpp and .h pairs like libraries would be much more manageable. It is good software engineering practice. Arduino .ino actually fosters bad practice by encouraging developers to lump everything into a single file. This is why I prefer a C++ IDE like Atmel Studio compared to arduino ide when developing on arduino.
Re: Using Arduino libraries on other C-compiler IDEs
Posted:
Fri Jun 12, 2015 2:51 am
by tytower
Well no actually . Its become practice to do it that way by many who just aren't software programmers . Thats the beauty of Arduino . People with no programming knowledge can pick it up immediately and call themselves C++ programmers.
Personally I use the Tabs and stick the functions that can be separated out in their own tab and call and return a value and you can overload them there too.