Page 117 - Programming the Photon Getting Started With the Internet of Things
P. 117
Figure 6.1 Windows command prompt.
Change the current directory to where you saved the contents of the ZIP file. You can
do this by typing “cd /file location/” (refer to Figure 6.1 for clarification). Once in the
directory we now should be able to run the command curl, which will list a few
commands that we can use initially. The command curl is what we are going to use to
send HTTP requests without having to use a Web browser. This method should be used
first to test out the functions before you start building a webpage.
Controlling an LED over the Internet
This experiment is similar to the first digital output experiment we did in Chapter 4. We
are going to connect an LED to digital pin D0 and send a command over the Internet to
turn the LED on and off. This is the basic principle of how to use the command, but in
theory you can use it turn almost anything on or off. The hardware we will be using can be
seen in Table 6.1 and the breadboard layout diagram in Figure 6.2.