Shop OBEX P1 Docs P2 Docs Learn Events
NEED HELP understanding file structure and how to save on Spin P1/P2 (Newbie) — Parallax Forums

NEED HELP understanding file structure and how to save on Spin P1/P2 (Newbie)

Questions about saving for spin
option
Save To:
Save as:

Copy my Library files to your Library (C:\Users\username\Documents\Propeller Tool\Library)
-- Copy demo programs to convenient location
Before I did all this I was collecting example code and some of it are for projects in files of their own. how do I copy and paste to the proper location. one folder is called tetris but from the Spin I open it but it does not show the other file to be saved.
also how do I keep projects with the files all together ?
how do I save and be able to find what goes together as a project?

Comments

  • JonnyMacJonnyMac Posts: 9,102
    edited 2021-10-02 02:10

    Save To:
    Save as:

    Both options open the Save As dialog, but Save To will preset the output path for you.

    I organize my project folder to hold the top-level app and any library/object that is exclusive to that project (a very rare event). By putting your libraries in the Library folder you can reduce redundant copies and the associated problems updating one and not another. If your project folders contain library files, open and compile the project, then look at the project tree in the upper left corner of Propeller Tool.

    Here's a project I'm coding for a friend:

    Yellow indicates the local folder, blue indicates the Library folder. In this case you can see that all of the objects I use in the project are in my master Library. For your objects (but not the top file) that are indicated with a yellow folder, click on the name in the project tree to open the file in an editor tab. Now use File --> Save To --> Propeller Library to copy the file to the master library folder. Once you've done this for all support files, they can be removed from your project folder (leave the project file there). When you do this and re-compile the project, the library files should be indicated with a blue icon in the project tree.

    Make sure you do this for every child object in the tree.

    how do I save and be able to find what goes together as a project?

    Propeller Tool will look in your project folder first, then the main Library folder. The files in use are listed in the OBJ section of your top file. This the OBJ section from that same project (WIP).

    obj
    
    ' main                                                          ' * master Spin cog
      i2c  : "jm_i2c"                                               '   i2c driver
      vsns : "jm_ina219"                                            '   power monitor
    ' com1 : "jm_hd485"                                             ' * serial for RS-485 coms
    ' com1 : "jm_fullduplexserial"                                  ' * serial xbee or modem
      an1  : "jm_mcp3208_ez"                                        '   analog inputs #1
      an2  : "jm_mcp3208_ez"                                        '   analog inputs #2
      di1  : "jm_mcp23008"                                          '   digital inputs #1
    
    ' to use with formatted programming
    ' -- use P2 DEBUG to save cog
    
      term : "jm_fullduplexserial"                                  ' * serial IO for terminal
    
    ' * uses cog when loaded
    
Sign In or Register to comment.