This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
university:tools:python-tutorial:tutorial2-read-buttons [12 Sep 2019 20:19] – [Background:] Doug Mercer | university:tools:python-tutorial:tutorial2-read-buttons [12 Sep 2019 20:27] – [Challenges:] Doug Mercer | ||
---|---|---|---|
Line 49: | Line 49: | ||
====Procedure: | ====Procedure: | ||
- | Open the read_buttons.py Python program in your favorite editor. The IDLE that comes with Python is handy because you can run the program directly from there. Scroll down to the Digital_in() function. You will see a series of if statements that read the state of an input pin, high or low depending on which of the buttons is pressed. The program then changes the background color of label for each input pin based on what was read. The Digital_in() function is called continuously whenever the Run button is selected. | + | Open the read_buttons.py Python program |
{{ : | {{ : | ||
Line 63: | Line 63: | ||
**For Further Reading:** | **For Further Reading:** | ||
+ | **Return to [[university: | ||
**Return to Python Tutorial [[university: | **Return to Python Tutorial [[university: | ||