I now found the documentation about the pins (https://docs.micropython.org/en/latest/esp8266/tutorial/pins.html) and was able to trigger a callback when pressing the big M5 button (btna):
print("Button was pressed: ", p)
B_M5 = Pin(37, Pin.IN, handler=on_wasPressed, trigger=Pin.IRQ_FALLING, debounce= 500)
In ogni caso potrai calibrare la bussola con lo sketc figure8_calibration.ino ruotando in varie direzioni M5STACK
In any case, you can calibrate the compass with the sketc figure8_calibration.ino by rotating in various directions M5STACK
I just thought, you were using the ui flow firmware previously right. I think there is an issue if you have flashed one of the micropython firmwares and try to use arduino afterwards without completely wiping the memory. Please try to use the erase tool in the M5 burner tool and then try and flash an arduino sketch again
Well, I have a couple of spots in my project that a button press would make things very easy. For example, I'm using M5ez for my interface, and use Blynk to display events on the M5 screen. I have backlight timeout set to 30 seconds. A new event doesn't turn the backlight back on, but a keypress does. So, in my if (newEvent) loop, I could have a M5.BtnA.press(), that would wake up the screen. Can I go into the M5ez library, figure out what happens after a real button press to wake the screen and replicate that? Yes, of course, and I have certainly tried that, but some of the items that need to be set are private, so calling them from a main loop is problematic. Rewriting that stuff so it's all public might work, but that solves one problem. I'd also like menus to time out - if there's no activity after going into a menu, I'd like it to time out and go back to the main menu. Again, code can certainly make that happen, but a M5.BtnA.press() would be a lot easier to implement... Does this make sense?
This means the M5Stack is officially certified for use with Microsoft Azure cloud services.
Below is a link to a video demo showing how to connect M5Stack to Azure using Mongoose OS. This video is targeted at Mac users but Mongoose OS can also be used on Windows or Linux.
Details on Mongoose OS: https://mongoose-os.com/
Details on Microsoft - Azure IoT Fundamentals: https://docs.microsoft.com/en-us/azure/iot-fundamentals/