Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How would I change my python code? s/4to10decoder py (3.5.3)- x Ele Edit Fgmat Bun Options Yndow telp import RP1.GPIO as GPIO import tine GPI0,

How would I change my python code?
image text in transcribed
image text in transcribed
s/4to10decoder py (3.5.3)- x Ele Edit Fgmat Bun Options Yndow telp import RP1.GPIO as GPIO import tine GPI0, setmode (GPIO.BCM) GPIO. setwarnings(False) ED 416 LED 121 DEC 9 DEC 88 DEC725 DEC 6 9 DEC 5 11 DEC 36 DEC 2 13 DEC 1 19 DEC 0- 26 GPIO.setup(LED 8, GPIO.OUT) GPi0.setup(LED 4, GPIO.OUT) GPIO.setup(LED 2, GPIO.OUT) GPIO.setup(LED_1, GPIO.OUT) GPIO,setup (DEC_9, GPIO.IN GPIO.setup(DEC_8, GPIO.IN) GPIO.setup (DEC 7, GPIO.IN) GP10. setup(DEC-6,GD10. IN GPIO.setup( DEC 5, OPIO. IN) GP10, setup( DEC-4,010. IN) GP10, set up(0EC-3, 10.1N) GPIO.setup (DEC 2, GPIO. IN) GPIO. setup(DEC 1,GPIO.IN) GP10, setup(DEC-0,GPIO, IN) PythonP DEC input(Enter a numbr (-9): ) nBin - [o,0,0,0) while DEC 0: Resainder int (DECK2) nBin[n) Remainder DEC int(DEC/2) x in reversed (nlin): print(x) I GP10.output (LED 8, nBIn[ 3 - . output (LED4, nBIn[2 GPIO.output (LED 2, nBIn(1 GPIO.output(LED 1. nBIn[0]) print "Check out which Dec is true/alse (on/of). print DEC9not (GPIO.input (DEC9) print DECnot (GPIO.Input (DEC B print DEC7not (GPio.input (DEC rint DEC 6 not (GPIO.input (DEC 6 print DEC 5not (GPIO.input (DEC 5 print "EC 4not (GPIO.input (DEC 4)) int "DEC3not (GPIO.input (DEC 3)) rint DEC 2ot (GPIo.input (DEC 2 print DEC 3not (GPIO.input (DEC 1 rint DEC.O Ot (GPIO.input (DEC o) t ine.sleep(a . Generate a random number using random.randint(0,9) (you need import random) and assign this generated number to Dec instead of manual input. Check the decimal outputs (D0 - D9). Which is true/false (on/off)

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

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions

Question

the journal entry will increase cash and increase capital

Answered: 1 week ago

Question

Explain all drawbacks of application procedure.

Answered: 1 week ago

Question

Explain the testing process of accounting 2?

Answered: 1 week ago

Question

Know the principles of effective service recovery systems.

Answered: 1 week ago

Question

Explain the service recovery paradox.

Answered: 1 week ago