Core2 BtnA, BtnB and BtnC not working with m5button library
I've tried M5.BtnA.IsPressed() and that didn't work.
So I tried M5.BtnA.addHandler(xxxx,TE_TOUCH) - that didn't work.
So tried creating a button that went down to 280 on the Y axis - that also doesn't work.
Has anyone got the 3 touch buttons to work?
felmue last edited by
just to make sure - are you calling
loop()? As far as I recall that is required to update button states.
Maybe try this M5Core2 example to verify the buttons work ok?
Yes I am calling the update; I have 9 other buttons working fine and the touch button works just not below the bottom of the screen.
I note that that example uses waspressed instead of ispressed.
I’ll try the example and I’ll try waspressed instead. Unfortunately this implementation prevents the use of gestures and double taps with these buttons but I can live with that.
I would much prefer to get this working through the button library though
felmue last edited by
ah, ok. There is an electrical / electrostatic issue with the three touch buttons as well. Maybe that is what you experience?
If M5Core2 is not plugged into USB, not sitting on a conductive surface or not hold in one hand and touched with the other the three touch buttons hardly work.
Unfortunately the M5Stack engineers did not implement real touch buttons (which ESP32 provides) but kind of use the edge of the touch screen.
I've managed to improve them a bit by adding some additional copper below - see here.
thanks for the help @felmue - ive got it working now - i think i must have been pretty tired because I have no idea how all 3 attempts failed.
It works with .waspressed and by attaching a handler to events for the M5.BtnA - I have no idea what I was doing wrong all 3 times.
I found one issue - it was a silly mistake in my handler logic :D but this does not explain .ispressed not working before.
Maybe its something to do with a lack of sensitiviity as well - but the important thing is - they do work and I've got it working.
But trying to make a button bigger all the way down to 280 does not seem to work - which is a shame becasue I have to make 2 declarations to the handler. but thats ok.