O'Reilly logo

Raspberry Pi Essentials by Jack Creasey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

TKinter switch demo

Since the action code for Python is so similar to that for TKinter, we will go directly to a TKinter interface for switch sensing. Since the plan is to eventually create push buttons for our Internet radio, let's show the breadboard schematic that we need to achieve this:

TKinter switch demo

Note

Warning: While the schematic shown is quite OK for breadboard use, it is not suitable where the wires to the switches are long (greater than a few inches). Notice that the GPIO pin would be exposed directly to any fault conditions. It is advisable to put at least a 1k Ohm series resistor to the GPIO pin. Never run the 5 Volt or 3.3 Volt supply through a long ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required