M5Dial - Button not working?
-
Hey guys,
New here and new to UIFlow2. Got a M5Dial that I am playing with. I got the encoder working etc. But I can't get the inbuilt button press in it working.
I have the "Button" added to my hardware list (it was included automatically based on my M5Dial hardware profile). Under it I can find the event "When button BtnA was X" which I have added. I have put a simple "set label0 to Hello". But it never triggers. I've tried pressed, clicked, held etc.
I tried in my loop as well to do a "if pressed" but that doesnt work either.
What am I missing? Do I need to initialise or configure the button somehow?
Here is the code generated for it,
def btnA_wasClicked_event(state):
global Background, image1, image2, image3, image4, label0, rgb, rotary, http_req
label0.setText(str('Clicked!'))def setup():
BtnA.setCallback(type=BtnA.CB_TYPE.WAS_CLICKED, cb=btnA_wasClicked_event) -
Hello @Fredde
make sure you have the
Update button, touch, etc. in loopblock activated inloop. E.g.def loop(): global label0 M5.update()Thanks
Felix -
@felmue Amazing felmue! Thanks that was it!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login