DIY How to Make a Cool Looking Watch - StickC - Easy to Do

by RonFrtek in Circuits > Arduino

1327 Views, 2 Favorites, 0 Comments

DIY How to Make a Cool Looking Watch - StickC - Easy to Do

DIY How to Make a Cool Looking M5Stack-STICKC Watch - Easy to Do

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

What You Will Need

FZ1L2ADK2ZPA3WG.LARGE.jpg
F1VNT9QK2ZPA3WH.LARGE.jpg

M5StickC ESP32: you can get it here

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

FZ3UPGFK2ZPA4VK.LARGE.jpg
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 Components

2019-11-21_17-23-25.jpg
2019-11-21_15-59-50.jpg
2019-11-21_16-01-24.jpg
2019-11-21_18-00-08.jpg
2019-11-21_18-00-46.jpg
  1. Click on "M5 Stack Stick C" Board to select it
  2. In "Properties" window select "Modules" and click "+" to Expand,
  3. Select "Display ST7735" and click "+" to expand it,
  4. Set "Orientation" to "goRight"
  5. Set "Background Color" to "ClBlack"
  6. Select "Elements" and click on blue button with 3 dots...

  7. Elements Dialog will show

  8. In the Elements Dialog drag "Text Field" from the right side to the left

  9. Click on the "Text Field1" on the left side to select it, then in the "Properties window" click on "Color" and set it to "aclWhite" and click on "Fill Color" and set it to "aclBlack" (You can play with the colors if you want)

    -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 )

    Close the elements window

  10. Add "Decode (Split) Date/Time" component

  11. Add "Formatted text" component

In Visuino Set Components

2019-11-21_18-02-40.jpg
2019-11-21_18-03-38.jpg
2019-11-21_18-05-33.jpg
2019-11-21_18-06-01.jpg
2019-11-21_18-06-43.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
  3. Select "M5 Stack Stick C" board and in the "Properties" window select "Modules" > "Real Time Alarm Clock(RTC)" > "Elements"
  4. Click on blue button with 3 dots and in the Elements dialog drag "Set Hour", "Set Minute" and "Set Second" to the left side
  5. Select on the left "Set Hour1" element and under "Properties" window set "Add Value" to "True" and "Value" to "1"
  6. Select on the left "Set Minute1" element and under "Properties" window set "Add Value" to "True" and "Value" to "1"
  7. Select on the left "Set Second1" element and under "Properties" window set "Add Value" to "True" and "Value" to "1"

Explanation:

"Value" means how much we want to add with each click of a button to the existing time (either hours,minutes or seconds)
"Add Value" means that we want to add the value to the existing time

In Visuino Connect Components

2019-11-27_12-07-46.jpg
time1.png
  1. Connect "M5 Stack Stick C" > Real Time Alarm Clock(RTC) > Pin [Out] to "DecodeDateTime1" component pin[In]
  2. Connect "DecodeDateTime1" component pin [Hour] to "FormattedText1" component "TextElement1" pin[In]
  3. Connect "DecodeDateTime1" component pin [Minute] to "FormattedText1" component "TextElement2" pin[In]
  4. Connect "DecodeDateTime1" component pin [Second] to "FormattedText1" component "TextElement3" pin[In]
  5. Connect "FormattedText1" component pin [Out] to "M5 Stack Stick C" board "Display ST7735">"Text Field1" pin [In]
  6. Connect "M5 Stack Stick C" > Buttons "A(M5)" to "M5 Stack Stick C" > Real Time Alarm Clock(RTC) > "Set Hour1" Pin [Clock]
  7. Connect "M5 Stack Stick C" > Buttons "B" to "M5 Stack Stick C" > Real Time Alarm Clock(RTC) > "Set Minute1" Pin [Clock]

Generate, Compile, and Upload the Arduino Code

2020-10-30_13-20-50.jpg
  1. 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. You can change the time using buttons "M5" for Hours and "B" for Minutes

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

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 (hours,minutes and seconds) using the StickC buttons and create a simple menu!

Stay tuned and check out my other tutorials here.