Question: How to we write the background, explain code and wiring of lab reading a pushbutton # ! / usr / bin / env python import

How to we write the background, explain code and wiring of lab reading a pushbutton #!/usr/bin/env python
import ...
LEdPin =17# pin17
LedPin2=19
ButtonPin =18
GPIO.setwarnings (False)
GPIO.setmode(GPIO.BCM) # Numbers GPIOs by standard marking
GPIO.setup(LedPin, GPIO.OUT) # Set LedPin's mode is output
GPIO.output(LedPin, GPIO.HIGH) # Set LedPin high(+3.3V) to turn off led
GPI0.setup(LedPin2, GPIO.OUT) # Set LedPin's mode is output
GPIO.output(LedPin2, GPIO.HIGH)?m # Set LedPin high(+3.3V) to turn off led
# Set ButtonPin's mode as input with the internal pullup
GPIO.setup(ButtonPin,
GPIO.IN, pulz_up_down mm= GPIO.PUD_UP)
While True:
)==( GPIO. input(ButtonPin)
else:
print ('... led off')
GPIO.output(LedPin, GPIO.HIGH)_# led off
GPIO.output(LedPin2, GPIO.LOW) # led on
 How to we write the background, explain code and wiring of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!