M5Core detects pressure on key A even if the key was not pressed at all.



  • I discovered by accident that the M5Core sends out a command via MQTT, even if the associated button was not pressed at all. Has anyone ever observed something similar. What can be the reason. It only occurs with key A.

    I have written a program to control my marquee in UIFlow. Here is the resulting Micropython code:

    def buttonA_wasPressed():
      global temp, prog_name, lfd_nummer, version, data_update, balkon, wohn_zimmer, testraum, message
      m5mqtt.publish(str('whg/balkon/markiese/strg'),str(lfd_nummer))
      lab_status.setText(str(lfd_nummer))
      lab_status.show()
      lfd_nummer = (lfd_nummer if isinstance(lfd_nummer, Number) else 0) + 1
      pass
    btnA.wasPressed(buttonA_wasPressed)
    

    Unfortunately, the indentations are swallowed. Is there a way to format code?

    Peter



  • Hello @Peter

    could be the issue discussed here. Or this one. Not sure how to fix though.

    Yes, you can mark a code block using the back tick three times in a row ``` at the beginning of the line before and after the code block.

    def buttonA_wasPressed():
    

    Thanks
    Felix



  • @felmue
    Thank you for the information.

    I will have a look at the links. At first glance it might fit.

    Peter



  • @felmue

    The tip has hit the problem. I have implemented a query of the key A in the callback routine after 1 ms. Only if the key is still pressed the routine is executed. Otherwise nothing is done. Now there are no more key presses from the ghost.

    Thanks