Sending Multiple Analog Input from arduino to visual studio

hi

i want to send three analog pin values to visual studio's different textbox.

i can send one value to the textbox(visualstudio) but i dont know how can i send three values with one serial port communications.

but i dont know how can i send three values with one serial port communications.

Serial.print(value1);
Serial.print(delimiter);
Serial.print(value2);
Serial.print(delimiter);
Serial.println(value3);

thanks for your reply :)

are you interested in visual studio ? which code i can use for receiving the three data and show it on three textbox ?

i can receive one data and show it on the one textbox with this code,

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO.Ports;

namespace ARDUINO_OLCUM
{
    public partial class Form1 : Form
    {
        private SerialPort myport;
        private DateTime datetime;
        private string in_data;

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            myport = new SerialPort();
            myport.BaudRate = 9600;
            myport.PortName = port_name.Text;
            myport.Parity = Parity.None;
            myport.DataBits = 8;
            myport.StopBits = StopBits.One;
            myport.DataReceived += myport_DataReceived;

            try
            {
                myport.Open();
                data_tb.Text = "";

            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.Message, "En PORTU SIKINTILI");

            }
            

        }

        private void myport_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
            in_data = myport.ReadLine();

            this.Invoke(new EventHandler(displaydata_event));
        }

        private void displaydata_event(object sender, EventArgs e)
        {
            datetime = DateTime.Now;
            string time = datetime.Hour + ":" + datetime.Minute + ":" + datetime.Second;
            data_tb.Text = in_data ;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            try
            {

                string pathfile = @"C:\Users\WS1\Desktop\DATA\";
                string filename = "light_data.txt";
                System.IO.File.WriteAllText(pathfile + filename, data_tb.Text);
                MessageBox.Show("Data has been saved to" + pathfile, "Save File");
            }
            catch (Exception ex3)
            {
                MessageBox.Show(ex3.Message, "Error");
            }
        }
    }
}

i can receive one data and show it on the one textbox with this code,

The arrival of serial data triggers the myport_DataReceived() method. That method uses

            in_data = myport.ReadLine();

to read the data. It then uses:

            this.Invoke(new EventHandler(displaydata_event));

to trigger the displaydata_event() event method of the UIthread, to deal with the data.

You could parse the data in that method, and display each token in a different text box. Or, use the string::split() to do the parsing for you.

i am planing to use split code

but i couldnt receive the data when i use Serial.print code(i saw on serial monitor but i couldnt see on visual studio's textbox)

  Serial.print(sensorValue);
  Serial.print("/");
  Serial.print(current);
  Serial.print("/");
  Serial.print(ms);

my visual code:

private void button1_Click(object sender, EventArgs e)
        {
            myport = new SerialPort();
            myport.BaudRate = 9600;
            myport.PortName = port_name.Text;
            myport.Parity = Parity.None;
            myport.DataBits = 8;
            myport.StopBits = StopBits.One;
            myport.DataReceived += myport_DataReceived;

            try
            {
                myport.Open();

                textBox1.Text = "";

                textBox2.Text = "";

                textBox3.Text = "";

            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.Message, "En PORTU SIKINTILI");

            }

            
           

        }

        private void myport_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
            in_data = myport.ReadLine();

            this.Invoke(new EventHandler(displaydata_event));
        }

        private void displaydata_event(object sender, EventArgs e)
        {

            string[] data;

            data = in_data.Split('/');

            textBox1.Text = data[0];

            textBox2.Text = data[1];

            textBox3.Text = data[2];

        }

Is myport_DataReceived() ever called? What did it receive from the serial port?

Is displaydata_event() called? What data is it called with?

Your last Serial.print() statement should probably be Serial.println().