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(1))

    else:

        pyb.LED(1).off()

        print(irq(0))

    time.sleep_ms(500)

el text "ON" serà imprès per la pantalla si el valor passat a la interrupció és superior a 0.

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!