DIY How to Display Time on M5StickC ESP32 Using Visuino - Easy to Do

by RonFrtek in Circuits > Arduino

2103 Views, 1 Favorites, 0 Comments

DIY How to Display Time on M5StickC ESP32 Using Visuino - Easy to Do

DIY How to Display Time on M5StickC ESP32 Using Visuino - Easy to Do Tutorial

In this tutorial we will learn how to program ESP32 M5Stack StickC with Arduino IDE and Visuino to Display the time on the LCD.

What You Will Need

FZ1L2ADK2ZPA3WG.LARGE.jpg
F1VNT9QK2ZPA3WH.LARGE.jpg
  1. M5StickC ESP32: you can get it here
  2. Visuino program: Download Visuino

Note: Check this tutorial here on how to Install StickC ESP32 board

Start Visuino, and Select the M5 Stack Stick C Board Type

F900ERLK2ZPA4Z1.LARGE.jpg
FA61ODUK2ZPA4VL.LARGE.jpg

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1)

in Visuino When the dialog appears, select "M5 Stack Stick C" as shown on Picture 2

In Visuino Add and Set Components

FZ3UPGFK2ZPA4VK.LARGE.jpg
2019-11-21_15-59-50.jpg
2019-11-21_16-01-24.jpg
2019-11-21_17-23-25.jpg
  1. Click on "M5 Stack Stick C" Board to select it
  2. In "Properties" window select "Modules" and click "+" to Expand, Select "Display ST7735" and click "+" to expand it
  3. Set Orientation to "goRight" < this means how the time will be oriented on the LCD
  4. Select "Elements" and click on blue button with 3 dots...
  5. Elements Dialog will show
  6. In the Elements Dialog drag "Text Field" from the right side to the left

Click on the "Text Field1" on the left side to select it, then in the "Properties window" click on color and set it to "aclOrange"

-also in properties windows set X:10 and Y:20 this is where you want to display the time on the LCD

-set size:3 this is the font size of the time

-You can set the text size and color if you want

Close the elements window

Optionally:

Click on "M5 Stack Stick C" Board to select it

In "Properties" window select "Modules" and click "+" to Expand, Select "Display ST7735" and click "+" to expand it and you will see "Background color" this is the default color of the display, change it to your favourite color, you can alse set display brightness, the default is 1 (max) you can set it to 0.5 or some other value to make it more dim

6. Add "Decode (Split) Date/Time" component
7. Add "Formatted text" component

In Visuino Set Components

2019-11-21_18-02-40.jpg
2019-11-21_18-03-38.jpg
  1. Select "FormattedTxt1" component and under "Properties" window set "Text" to: %0:%1:%2
  2. Double click on "FormattedText1" component and in the Elements dialog drag 3x "Text Element" to the left

In Visuino Connect Components

time2.png

  • Connect "M5 Stack Stick C" > Real Time Alarm Clock(RTC) > Pin [Out] to "DecodeDateTime1" component pin[In]
  • Connect "DecodeDateTime1" component pin [Hour] to "FormattedText1" component "TextElement1" pin[In]
  • Connect "DecodeDateTime1" component pin [Minute] to "FormattedText1" component "TextElement2" pin[In]
  • Connect "DecodeDateTime1" component pin [Second] to "FormattedText1" component "TextElement3" pin[In]
  • Connect "FormattedText1" component pin [Out] to "M5 Stack Stick C" board "Display ST7735">"Text Field1" pin [In]

Generate, Compile, and Upload the Arduino Code

2020-10-30_13-20-50.jpg
  • In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

If you power the M5Sticks module, the display should start to show the time.

Congratulations! You have completed your M5Sticks project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it here.

You can download and open it in Visuino: https://www.visuino.com

Extra: Simple Trick

2019-11-23_14-02-36.jpg
2019-11-23_14-07-14.jpg

You can use the current time that was on your computer on the moment you compiled the code in Arduino.

  • To do that just drop a "Compile Date/Time" component and connect it to "M5 Stack Stick C" > "Real Time Alarm Clock(RTC)" pin [Set]

You can download the Project file with this trick here.

In the Next Tutorial..

In the next tutorial I will show you how to make a Cool Looking watch where you can set the time using the StickC buttons!
Stay tuned and check out my other tutorials here.