Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago