Use the smallest timer library from Polish Arduino forum: http://bit.ly/arduinotimer - in file TimersForumArduino.zip
Thus, I get the M5StickC that is an amazing device (as you can see in exemplary projects from https://www.hackster.io/m5stack) based on a ESP32 development board with 0.96 inch TFT color screen (80 * 160 resolution - very bright and clear), Red LED, two user buttons and a power switch, Microphone, IR transmitter, 6-axis IMU (SH200Q) and 80 mAH battery. The ESP32 module ESP32-Pico in M5StickC also has a built-in 4MB flash. I with my son made not only usual dices (from 1 to 8 ones), but also a special version for boardgame Memoir'44 - https://boardgamegeek.com/boardgame/10630/memoir-44.Previously, it is mandatory install the development environment. If you use the Arduino IDE, exists a perfect guide to start up the device : M5StickC Quick Start - Arduino Win
Finally, this is the configuration that you need to compile the Arduino sketch of M5StickCDicesForMemoir44 for 1-8 Memoir'44 dices or M5StickCDices for usual 1-8 dices.
Now only that you need is plug in the M5Stick whith the USB-C adaptor and load the program.
Execute the lcd-image-converter from this repository.
- Png or Jpg is read from File->Open Menu. The image will be displayed when loaded.
- Select: Option->Conversions Menu. The top Preset: selects "Color R5G6B5".
- Select: Image tap and select “8 bit” for Block size :. Press "OK".
- The example "Tank.c" is output by "Convert ..." in File-Convert Menu. Know in advance the destination path. Tick: Import All Images You can also output all the images with “Convert ... all”.
- Edit .c converted file. You will get an error as it is, so fix it with your editor.
- Change: "Static const uint8_t image_data_Tank [4690] = {" at the top of the file deleting "image_data_" as result of "static const uint8_t Tank [4690] = {".
- At the bottom of delete de entire line: "const tImage Tank = {image_data_Tank, 35, 67, 8};
- Save the example "Tank.c"
The M5Stick-C is a device with multiple components as processor, sensors, interrupters and LED. The processor features are:
Red LED & IR transmitter & BUTTON A & BUTTON B
ESP32 chip | GPIO10 | GPIO9 | GPIO37 | GPIO39 |
Red LED | LED pin | |||
IR transmitter | transmitter pin | |||
BUTTON A | button pin | |||
BUTTON B | button pin |
TFT Screen
Driver IC: ST7735S
Resolution: 80 * 160
ESP32 chip | GPIO15 | GPIO13 | GPIO23 | GPIO18 | GPIO5 |
TFT Screen | TFT_MOSI | TFT_CLK | TFT_DC | TFT_RST | TFT_CS |
GROVE interface
ESP32 chip | GPIO33 | GPIO32 | 5V | GND |
GROVE interface | SCL | SDA | 5V | GND |
Microphone (SPM1423)
ESP32 chip | GPIO0 | GPIO34 |
Microphone | SCL | SDA |
6-axis IMU (SH200Q) & Power Mangement IC (AXP192)
ESP32 chip | GPIO22 | GPIO21 |
6-axis IMU (SH200Q) | SCL | SDA |
Power Mangement IC (AXP192) | SCL | SDA |
**M5StickC Memoir'44 Dices
Some projects are not mine among them:
- https://github.com/McOrts/M5StickC_Nixie_tube_Clock
- https://github.com/BLavery/virtual-GPIO
- https://github.com/Sash0k/bluetooth-spp-terminal
- https://github.com/maik/pragpub
- https://github.com/DavidAndrews/Arduino_LCD_Menu
- https://github.com/extrasleepy/Device-Invention
- https://github.com/dserv01/SimpleUI16x2
- https://exploreembedded.com/wiki/
- http://arduino.cc
- https://github.com/zerokol
- https://github.com/arkhipenko/TaskScheduler
- https://github.com/gioblu/Agenda
- https://github.com/jonblack/arduino-menusystem
- https://github.com/Sash0k/bluetooth-spp-terminal