Learn MicroPython #4 - Interrupts (event-driven code)

Поделиться
HTML-код
  • Опубликовано: 27 дек 2024

Комментарии • 22

  • @capiberra4118
    @capiberra4118 5 лет назад +3

    Thanks for this set of M/P tutorials, very useful stuff indeed. This one caught my eye initially but i have since been back and watched the whole set. Well presented, well paced, clearly explained. Well done, Thanks!

  • @bgable7707
    @bgable7707 4 года назад +1

    Nicely done, great simple example of IRQ's, ie Interrupt Request Queue, as I know them. Thanks for your work!

  • @josseman
    @josseman 3 года назад

    I just found out about your channel and I love it! Thank you so much

  • @ThalassTKynn
    @ThalassTKynn 2 года назад

    Hey thanks for the video. I found it while trying to troubleshoot my code. I followed your code, and have it just like yours is at 13:05, minus the sleep timer and with a print statement instead of the led output. Even though I have the handler set to IRQ_RISING it reacts for both rising and falling events. I thought it might be a debouncing issue but it still happens with a SPST switch instead of the tactile momentary switch. There is a debouncing issue still, but the it stops printing after about 5 times. But it does this for both states.
    I'm running the code on an old Huzzah ESP8266 breakout with micropython v1.17
    I'm gonna keep looking but any advice would be appreciated! Thanks!

  • @davidmarks509
    @davidmarks509 2 года назад

    Igreat tutorial I am really looking forward started today with micropyton. TY

  • @elliot1784
    @elliot1784 4 года назад

    im having an issue.. My code is identical to yours.. but before I run it I get this yellow warning error: "Unresolved attribute reference 'irq' for class 'Pin'"
    then when I run it.. I get an error:"TypeError: can't convert 'int' object to str implicitly"
    any help? thanks

  • @IRBry
    @IRBry Год назад

    Interrupt Re Quest idk where you got query from

  • @minecraftteddy99
    @minecraftteddy99 5 лет назад

    How do I do long press ? Maybe I want the LED to turn on when I click the button and when I hold the button the LED should turn off.

  • @annasarahkramerfazendeiro8030
    @annasarahkramerfazendeiro8030 4 года назад

    Thank you for this series, well explained! While this video shortly touches the possibility of having several interrupt pins, I still don't understand how to actually do this. I have 2 motors and 4 limit switches, so I want each motor to stop moving in a certain direction when it reaches the associated limit switch (movement controlled by a system of 3 relays per motor). Would I need 1 function and 4 irq objects? Or 2 functions? Is there any explanation or tutorial I could follow to understand this better? Thanks a lot!

  • @ta77o
    @ta77o 5 лет назад

    good morning,
    I wanted to get the value of the pin that got the interruption.
    example:
    def callback (pin_irq):
    print (pin_irq)
    result:
    Pin (14)
    I need only the value 14 not "Pin (14)"
    how can I do it?

  • @Huynh-Tan-Quoc
    @Huynh-Tan-Quoc 4 года назад

    i have a M5stack board. so, i want to create a event for textbox or create eventhandl, how do you do?

  • @Kasslim11
    @Kasslim11 4 года назад

    My guess is that Micropython has a scheduler. Which is how it can make the interrupts' event handlers queue behind each other. The way interrupts work on machine level is much more complicated with priorities etc. Is my guess correct?

  • @sergiomoranavarrete9426
    @sergiomoranavarrete9426 4 года назад

    Why my led stays On even when i release the btn. ?

  • @thepierced
    @thepierced 5 лет назад

    Hi and thanks for the video. I work with a ESP32 and I can't explain why when I press the button, it happen randomly like multiple presses. I tried to add a 10K resistor OR / AND use the Pin.IN.PULL_UP Pin() parameter. Do you have a idea please? Thanks!

    • @HHashi
      @HHashi 5 лет назад +2

      I know your comment is 2 months old but just in case you still haven't solved this, it sounds like you need to look into "debouncing". The issue you're facing is caused by noise, i.e. when you press down on the button, the signal will fluctuate up and down until it settles. Debouncing is a way to deal with this.

    • @thepierced
      @thepierced 5 лет назад +1

      Thanks I agree with you, I will try to play with a debounce timer.

  • @anthonyanderson2752
    @anthonyanderson2752 4 года назад

    Why doesn't this require a while loop?

  • @freddymac128
    @freddymac128 4 года назад

    Can you make a video on using ESP-CAM with Micropython?!

  • @mrem8804
    @mrem8804 5 лет назад +1

    It's possible to use threadding with MycroPython? To listen interrupts and execute at the same time. Thanks...

    • @inventboxtutorials1898
      @inventboxtutorials1898  5 лет назад

      Yes and no. Threading is only supported on some MicroPython ports at the moment.
      In their own documentation about the _thread module, they say:
      "This module is highly experimental and its API is not yet fully settled and not yet described in this documentation."
      I think the ESP32 port supports threading. Feel free to play with it. If you find that the threading is not working, you can use timers as an alternative to jumping between two tasks.

  • @GmanBB
    @GmanBB 4 года назад

    no irq function...

  • @ec92009y
    @ec92009y 3 года назад +2

    Nice but almost unwatchable. You have a very annoying fan running through the whole video.