✅ 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 timeimport pybdef 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.
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!