You can try replacing the following line in the Sketch:
#include <M5Stack.h>
With:
#include <M5Unified.h>
That should resolve the compilation error.
You can try replacing the following line in the Sketch:
#include <M5Stack.h>
With:
#include <M5Unified.h>
That should resolve the compilation error.