How to Send Data From M5Stack StickC to Delphi

by RonFrtek in Circuits > Arduino

1239 Views, 1 Favorites, 0 Comments

How to Send Data From M5Stack StickC to Delphi

How to send data from M5Stack StickC to Delphi

In this video we will learn how to send values from StickC board to Delphi VCL Application using Visuino.

Watch the video.

What You Will Need

FGK0UC5K2ZPA3U5.LARGE.jpg
F4O2K8LK54FYLTM.LARGE.jpg
images (6).png
commlab.jpg

- M5StickC ESP32: you can get it here

- Visuino program: Download Visuino

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

- Delphi - Embarcadero Link

Learn how to install Delphi here

- Mitov CommunicationLab for Delphi, download here

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

FRWQB80K1RVKKV9.LARGE.jpg
FOZ545RK54FYLVV.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 Connect Components

2020-04-13_13-57-14.jpg

  • Connect the pin (with the value that you want to send to the Delphi application) to the serial[0] pin

in our case we connected Battery voltage pin to the serial[0] pin

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.

Start Delphi and Add Components

2020-04-13_15-06-23.jpg
newVCL.jpg
2020-04-13_14-15-38.jpg
2020-04-13_14-16-14.jpg
2020-04-13_14-15-38.jpg
2020-04-13_14-17-10.jpg
2020-04-13_14-17-52.jpg
2020-04-13_14-18-26.jpg
  • In Delphi create New Windows Vcl Application
  • In palette window find 'TCLComPort' component and drag it to the Form
  • In the Object Inspector set the port of the StickC board (you can find the port number in Arduino>Tools>Port
  • In palette window find 'CLTerminal' component and drag it to the Form
  • In the Object Inspector double click on the 'InputPin' and in the connections window select 'CLComPort1'
  • Click on the green Run button in Delphi

Play

2020-04-13_14-59-41.jpg

If you power the M5Sticks module (connected via USB to the computer), it will start to send data to the Delphi application.

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