Page 52 - Programming the Photon Getting Started With the Internet of Things
P. 52

void loop {


        }
        EOS

            fi




            # Initialize the git repo if it's not already one

            if [ ! -d ".git" ]; then
                GIT=`git init`
                echo " ==> ${GIT}"
            fi



            echo "Creation of ${LIB_NAME} complete!"
            echo "Check out https://github.com/spark/uber-library-example for more
        details"

        }



        Step 2: Call the function.


        Create_spark_library this-is-my-library-name

             Replace this-is-my-library-name with your actual library name. It should all be in

        lowercase letters and dashes between the names.




        Step 3: Edit the spark.json firmware .h and .cpp files.

        Use the repository as your guide to good library conversions.




        Step 4: Create a Github repo and push to it.



        Step 5: Validate and publish via the Particle IDE.

        To validate, import, and publish the library, go to the Particle Build IDE and click the Add

        Library button.

             Don’t worry if you don’t understand how to create a library yet, as this is for advanced
        users.  There  is  plenty  of  support  available  on  the  Particle  community  site  if  you’re
        struggling.
   47   48   49   50   51   52   53   54   55   56   57