logo

Crowdly

En el codi següent import time import pyb def irq(valor):     if (val...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

En el codi següent

import time

import pyb

def irq(valor):

    if (valor > 0):

        return "ON"

    else:

        return "OFF"

while True:

    if pyb.Switch().value():

        pyb.LED(1).on()

        print(irq(0))

    else:

        pyb.LED(1).off()

        print(irq(0))

    time.sleep_ms(500)

el text "ON" serà imprès quan el led estigui encès i el text "OFF" serà imprès quan el led estigui apagat.

40%
60%
More questions like this

Want instant access to all verified answers on ad.uib.es?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome