Skip to content

pwasiewi/arduinolab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArduinoLab - my arduino laboratory exercises.

Use the smallest timer library from Polish Arduino forum: http://bit.ly/arduinotimer - in file TimersForumArduino.zip

Dice rolling using the Arduino device was always in my dreams

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.

How to load the sketch

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.

Update dice images

Execute the lcd-image-converter from this repository.

  1. Png or Jpg is read from File->Open Menu. The image will be displayed when loaded.
  2. Select: Option->Conversions Menu. The top Preset: selects "Color R5G6B5".
  3. Select: Image tap and select “8 bit” for Block size :. Press "OK".
  4. 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”.
  5. 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"

Hardware components

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 chipGPIO10GPIO9GPIO37GPIO39
Red LEDLED pin
IR transmitter transmitter pin
BUTTON A button pin
BUTTON B button pin

TFT Screen

Driver IC: ST7735S

Resolution: 80 * 160

ESP32 chipGPIO15GPIO13GPIO23GPIO18GPIO5
TFT ScreenTFT_MOSITFT_CLKTFT_DCTFT_RSTTFT_CS

GROVE interface

ESP32 chipGPIO33GPIO325VGND
GROVE interfaceSCLSDA5VGND

Microphone (SPM1423)

ESP32 chipGPIO0GPIO34
MicrophoneSCLSDA

6-axis IMU (SH200Q) & Power Mangement IC (AXP192)

ESP32 chipGPIO22GPIO21
6-axis IMU (SH200Q)SCLSDA
Power Mangement IC (AXP192)SCLSDA

**M5StickC Memoir'44 Dices

M5StickCMemoir44

Software components

Some projects are not mine among them:

About

M5StickC, Timers, FreeRTOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published