logo

Crowdly

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

✅ 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):

    print(valor)

while True:

    if pyb.Switch().value():

        pyb.LED(1).on()

        irq(1)

    else:

        pyb.LED(1).off()

        irq(0)

    time.sleep_ms(50)

el led s'encén quan el polsador de l'usuari està clicar i apaga el led quan el polsador està sense clicar.

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!