Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumDiscussionGeneral Discussion, Status › Tabs & multiple files?

Page Index Toggle Pages: 1
Tabs & multiple files? (Read 4103 times)
03/15/11 at 06:33:49

Zap   Offline
YaBB Newbies
Tnks Zap
Ausi

Posts: 22
*
 
Is there any examples & instructions on how to use the Tabs with multiple files?
I'm working on a large project and have created a number of sketches for each module of it.  How can I use the tabs to 'include' all the parts of the project.

Thanks Zap.
 

IP Logged
 
Reply #1 - 03/15/11 at 17:30:41

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
hi Zap, you can include .h .cpp or .c files inside the sketch directory, when launching Wiring and opening the sketch those files will appear as tabs in the sketch. You can also use the tab button on the right in the menu bar and create a tab giving it the name you want. You can also add files through the Sketch -> Add files menu. Let me know.
 
IP Logged
 
Reply #2 - 03/15/11 at 22:55:58

Zap   Offline
YaBB Newbies
Tnks Zap
Ausi

Posts: 22
*
 
Thanks for that but now I'm a bit more confused, I've written all the modules ( parts ) of this project as separate .pde sketches (not .h .cpp or .c) for individual testing debugging.
There is a main module ( the timing & scheduling module) that will call all the other modules ( LCD menu & data display, $GPZDA module, logging (SD card) module and hardware I/O module)
Do I strip these called 'module' sketches down to being just functions and put them on separate tabs?

I would like not to have all the modules in one sketch having to scroll back and fourth through hundreds of lines for debugging.

Thanks Zap.
 

IP Logged
 
Reply #3 - 03/16/11 at 17:14:17

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
Ok, so what you really need to do is a library, which you can do not as .pde files but as .cpp and .h or .c files, please check libraries included with the Wiring distribution like LiquidCrystal or Messenger as an example, then you could put your library in your sketchbook/libraries folder if this directory doesn't exist you can create it, so it will be something like your sketchbook/libraries/mylibrary inside you put your libraries files you have developed, like mylibrary.cpp mylibrary.h or mylibrary.c etc.
When launching Wiring your library will appear in the menu Sketch->Import Library at the bottom, when doing a sketch you can include your library on it with this menu.  You'll notice a line will be added to your sketch like #include "mylibrary.h" and you'll be able to use your library code inside your sketch without having it directly on it.
Let me know.
 
IP Logged
 
Reply #4 - 03/16/11 at 17:14:54

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
I have scheduled a tutorial for the tutorials section for this. It will be there for next release.
 
IP Logged
 
Page Index Toggle Pages: 1