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

}
                   else {

        execute the code here if both conditions A and B are both false. This will
        always be the default option
        }


             You can use as many if else statements as you like within the code, or you may have
        an  else  statement  at  the  end  of  the  chain  for  the  code  that  should  be  executed  if  all
        conditions return false.




        Summary


        In  this  chapter  we  have  looked  at  some  of  the  programming  features  that  are  used  to

        control both analog and digital inputs on the Photon. These programming functions will be
        the key to creating your very own projects with the Photon. You should now be able to
        create your own circuits using both inputs and outputs.

             In the next chapter we will look at controlling circuits using the Internet, from a simple

        command line to a Hypertext Markup Language (HTML) website.
   109   110   111   112   113   114   115   116   117   118   119