Programming the M5StickC with the Arduino IDE
The M5StickC is a mini version of the M5Stack and also based on the ESP32 microcontroller. It is a user-friendly and open-source IoT development board. The M5StickC programming is possible with UIFlow, MicroPython and of course the Arduino IDE. There are countless extensions available that are easy to connect to the Grove or HAT ports. In addition, you can of course also develop extensions for these standard connections.
Furthermore, the M5StickC is equipped with a battery with an associated charging circuit and a TFT color screen. All of this is in a compact and sturdy housing, making it an ideal platform for developing portable or “wearable” projects.
- Based on the ESP32 microcontroller with 4 MByte Flash and WiFi / Bluetooth
- TFT Color Screen 80×160 (0.96 “, Driver IC: ST7735S)
- An LED (red)
- 2 buttons
- 6-axis motion sensor (SH200Q)
- Real-time clock (BM8563)
- Infrared (IR) LED
- 80 mAh Lipo battery with charging circuit
- Expansion port (HAT)
- Grove port
- USB Type-C for programming, charging and power supply
Programming M5StickC: prepare the Arduino IDE
To be able to program the M5StickC with the Arduino IDE you must first have installed the IDE together with the ESP32 core for the Arduino IDE. How you can do this is described in detail in the blog “ESP32 with Arduino IDE on Linux and Windows“. In short, it comes down to the following:
- Download and install the Arduino IDE. For more information, you can read the blogs “Installing the Arduino IDE on Windows 10” or “Install or upgrade to the latest Arduino IDE on Linux“.
- Start the IDE and open “Preferences” via menu File > Preferences.
- Enter this URL in the “Additional Board Manager URLs” field:
- Open “Boards Manager” via menu Tools > Board > Board Manager and install the esp32 platform.
Install M5StickC Arduino libraries
To make programming easy, there are libraries and corresponding sample programs available that you can easily install via the IDE.
- Go to Sketch > Include library > Manage libraries …
- Search for “M5StickC” and install the library
- When the installation is complete you can find the examples via the menu File > Examples, under “Examples for M5 Stick-C” and “Examples of Custom Libraries“.
Select the M5StickC
Finally, you must now choose the M5StickC as the board, with the correct settings.
- Go to menu Tools and choose “M5Stick-C” at “Board“
- At “Upload Speed” choose “1500000“
- At “Port” you select the correct COM port for the M5Stick-C.
No drivers are required for recent versions of Windows, Linux, and macOS. If the device is not recognized as a USB device, you can download the Virtual COM Port Drivers from FTDI here.
Programming M5StickC with the Arduino IDE
Everything is now ready to upload sketches to the Stick, for example, one of the sample sketches. Note that it is switched on, otherwise, the upload will not work. You can turn on the Stick by briefly pressing the power button. You can turn it off again by holding down the power button for longer.
You can address the various hardware components in your sketches by using the GPIOs below.
|00||MIC SCL / HAT|
More information about the Stick can be found here:
- GitHub: https://github.com/m5stack/M5StickC
- Documentation: https://docs.m5stack.com/#/en/core/m5stickc
- Forum: http://forum.m5stack.com/
- YouTube: https://www.youtube.com/playlist?list=PLgvIHLw9-cydgZeVPxwdvXlEgxCKsrs97
To be continued
After this introduction, there will certainly be fun projects with the M5StickC on this blog. Have you made something nice yourself? Let us know in the comments below!
It’s very well documented. It was helpful. Thank you.