Skip to Content
Internet of Things with Python
book

Internet of Things with Python

by Gastón C. Hillar
May 2016
Intermediate to advanced content levelIntermediate to advanced
388 pages
9h 9m
English
Packt Publishing
Content preview from Internet of Things with Python

Wiring digital input pins with pushbuttons

Now, we will use the following pins to connect the two pushbuttons and we will work with pull-up resistors:

  • Pin 1 (labeled D1/TX) to connect the pushbutton that turns off the three colors
  • Pin 0 (labeled D0/RX) to connect the pushbutton that sets the three colors to their maximum brightness levels

After we finish the necessary wirings, we will write the Python code to check whether each pushbutton was pressed while keeping our RESTful API working as expected. This way, we will make it possible for the user to interact with the RGB LED with the pushbuttons and also with the RESTful API. We need the following additional parts to work with this example:

  • Two pushbuttons with two pins
  • Two 120Ω resistors with 5% ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Getting Started with Python for the Internet of Things

Getting Started with Python for the Internet of Things

Tim Cox, Dr. Steven Lawrence Fernandes, Sai Yamanoor, Srihari Yamanoor, Prof. Diwakar Vaish

Publisher Resources

ISBN: 9781785881381Supplemental Content