Question: Explanation about the code and the wire in depth # ! / usr / bin / env python import... LedPin = 1 7 # pin

Explanation about the code and the wire in depth
#!/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
GPIO.setup(LedPin2, GPIO.OUT) # Set LedPin's mode is output
GPIO.output(LedPin2, GPIO.HIGH) # Set LedPin high(+3.3V) to turn off led
# Set ButtonPin's mode as input with the internal pullup
GPIO.setup(ButtonPin,
GPIO.IN, pull_up_down mm GPIO.PUD_UP)
while True:
)==( GPIO. input(ButtonPin)
GPIO.output(LedPin, GPIO.LOW) # led on
GPIO.output(LedPin2, GPIO.HIGH) # led on
else:
print ('... led off')
GPIO.output(LedPin, GPIO.HIGH)_# led off
GPI0.output(LedPin2, GPIO.LOW) # led on
 Explanation about the code and the wire in depth #!/usr/bin/env python

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!