Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Python script that will use a function called FlashPins to blink a list of GPIO pins for a given number of times depending
Write a Python script that will use a function called "FlashPins" to blink a list of GPIO pins for a given number of times depending on user inputs. To be noticed that "FlashPins" takes two arguments pin_list", and "count", where "pin_list" represents a list of GPIO pins to be blinked, and "count" determins the number of times the pins must be blinked. For each blink the pins should be on for 2 seconds and off for 2 seconds. def count) i in count) for pin GPIO output for pin GPIO output GPIO.LOW) choice = ("Enter your choice between 1 and 4") 4") ("How many times to blink?:") " count = = choice == 1: "You chose to blink pin 15" =[15] (pin_list choice == 2: "You chose to blink pins 7 and 9 =1 (pin_list choice = 3: "You chose to blink pin 10" =[10] (pin_list choice ==4 "You chose to blink pins 11 and 12 (pin_list else: print option not available time sleep [10] input GPIO.HIGH Flash Pins 17. 9) [11.12) pin for print range if count 2 in elif pin_list
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started