In this section, we will run and interact with a Python server program that will let us control our LED from a web browser by copying and pasting links. Once we have used the program to control our LED, we'll then delve into the mechanics of the code and how it works in the next section.
Here are the steps to follow:
- Run the chapter02/dweet_led.py program. You should see output similar to the following:
(venv) $ python dweet_led.py
INFO:main:Created new thing name a8e38712 # (1)
LED Control URLs - Try them in your web browser:
On : https://dweet.io/dweet/for/a8e38712?state=on # (2)
Off : https://dweet.io/dweet/for/a8e38712?state=off
Blink : https://dweet.io/dweet/for/a8e38712?state=blink
INFO:main:LED off
Waiting for dweets. Press Control+C to exit.
On line (1), the program has created a unique name for our thing to use with dweet.io. You'll notice this name in the URLs starting on...