Skip to content
Discussion options

You must be logged in to vote

I guess the following method adds an interrupt service routine to the GPIO:
btnA.wasPressed(buttonA_wasPressed)

This works even, if your main thread is blocked. This interrupts the main thread and the ISR is called and after this, the main thread continues the work.

But you can test it easily:

from m5stack import *
from m5ui import *
from uiflow import *


setScreenColor(0x111111)
label0 = M5TextBox(13, 9, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)


def buttonA_wasPressed():
    label0.setText('Hello M5')

btnA.wasPressed(buttonA_wasPressed)

# busy loop
while True:
    pass

If then a button press still changes the text, then it's an ISR.

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@davefes
Comment options

Comment options

You must be logged in to vote
4 replies
@davefes
Comment options

@cristian-spiescu
Comment options

@davefes
Comment options

@davefes
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by cristian-spiescu
Comment options

You must be logged in to vote
1 reply
@davefes
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
ESP32
Labels
None yet
3 participants