You can run the VisualStudio Code platformIO. It supports the M5Stack ESP32.
I have copied the M5_Stack_WiFi_Scanner demo arduino ino file into the platform io editor.
I downloaded the code to my M5Stack (black) and it worked.
Please play attention: In contrast to the arduino environement the VisualStudio Code PlatformIO is a one pass compiler, so you must place all subroutines (eg void Show(), Search()) at the beginning of your program (loop, setup ...) before they are called.
Yes, correct I used the " M5.Lcd.setTextColor (YELLOW, BLACK);" in the setup command , and effectively overwriting by deleting the above. Thank you.
Greetings.
According to several forum, Wire library require interrupt itself while any further interrupt is disabled during ISR call , so this example cannot work .
Only way to make working should be moving outside wire.read() function inside a proper function registered on Wire.onReceive call ( that i'm pretty sure get called from a proper interrupt ).
will make some test
Hopefully, you will find the solution. Honestly, I have no time to dig further. Good luck.
Does anyone know how to 'redirect' the UART on Pin 17 for sending to Pin 9. This since the IR-Led on the M5StickC and others within the M5-Family is build connected to Pin 9. It would be interesting to have that light use the irDA protocol, since it is already available inside it.
Thanks all for the insight. I've looked at the flowUI and at making an interface in the Arduino IDE. The flowUI is really easy with great looking results but I really doubt I can get the frame rates where I'd like them in an interpreted language. I also think that writing an interface natively in the Arduino IDE would have a big impact on the frame rates as well. I may have to look at some co-processor arrangement where flowUI Handles the higher level functions and issues commands to a procesessor handling the IO.
You would be correct with processing as the arduino allows access to all 3 of the esp32's cores where as micropython code runs on one core, the interpreter runs on the other and the 3rd, the ULP core is inaccessible.
Thanks again for your time and insight. I'm really impresses with the M5Stack, I have a lot of learning to do.
@hague I could be wrong, but I believe if you use as lib_deps is a better solution, because the PlatformIO can update automatically the library in the future. Not only that, your code build more faster (because the library use a shared objects - *.o files).
Other interesting point is to add more libraries to project. But again, this is IMHO about the way to use PlatformIO.
You need just one Serial;
Serial.begin(10000000);
//connect to proper TX<>RX pins of M5Stack
For proper debug you can connect sensor with any USB<>UART board and try to run it with any terminal software (I use TeraTerm)
If you want to debug derictly with M5Stack you will need Serial2 as your example shows, but keep in mind that if its a software serial, such high speed wont work properly most likely