Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
university:tools:python-tutorial:tutorial2-read-buttons [12 Sep 2019 20:19] – [Background:] Doug Merceruniversity: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 (from {{ :university:tools:python-tutorial:read_buttons.zip |read_buttons.zip}}) 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.
  
 {{ :university:tools:python-tutorial:python_tutorial2_f2.png?200 |}} {{ :university:tools:python-tutorial:python_tutorial2_f2.png?200 |}}
Line 63: Line 63:
 **For Further Reading:** **For Further Reading:**
  
 +**Return to [[university:labs:intro_ee|Introduction to Electrical Engineering]] Lab Activity Table of Contents**\\
 **Return to Python Tutorial [[university:tools:python-tutorial:table-of-contents|Table of Contents]]** **Return to Python Tutorial [[university:tools:python-tutorial:table-of-contents|Table of Contents]]**
  
university/tools/python-tutorial/tutorial2-read-buttons.txt · Last modified: 20 Jun 2022 20:39 by Doug Mercer