Exposed like this, it sounds just so simple! I really need to check it out. I had a project for a long time and never was able to realize it (I am not much of a C# programmer). Thanks for exposing it.
You are Welcome. And don't forget to check my android software : play.google.com/store/apps/details?id=com.buttressys.filechat Demo: th-cam.com/video/IwKOTgl5HwA/w-d-xo.html
Arduino sends data to c# application serially in the type of string. You can convert string to long in c# using following code before chart.invoke long lvar = (long)Convert.ToDouble("223.22");
@@swikbymirtahaali i got System.NullReferenceException: 'Object reference not set to an instance of an object.' i request you to reply always show port is null
@@swikbymirtahaali using System; using System.IO.Ports; 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.Threading; namespace chumma {
public partial class Form1 : Form { SerialPort port; string getval; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { String[] ports = SerialPort.GetPortNames(); foreach (string port in ports) { Portlist.Items.Add(port); } } private void BtStart_Click(object sender, EventArgs e) { Thread SerialVal; SerialVal = new Thread(runit); SerialVal.Start(); port = new SerialPort(Portlist.Text, Convert.ToInt32(baudrate.Text)); port.Open();
Exposed like this, it sounds just so simple! I really need to check it out. I had a project for a long time and never was able to realize it (I am not much of a C# programmer).
Thanks for exposing it.
For big fans of sine waves, just change
for (int x = 0; x0; x--)
{
delay(100);
Serial.println(x);
}
into
for (int x = 0; x
Sir
How to make 2 chanell..
Thanks🎉🎉🎉
what if i have double x = 10.5
C# show me the error. How to fix it? .When i use your code everything is working.
How to convert the X axis from time change to number in ascending order?
System.FormatException: 'Input string was not in a correct format.'
I have this error I hope you could help me
Thanks! It really helped me to finish a project!
You are Welcome. And don't forget to check my android software :
play.google.com/store/apps/details?id=com.buttressys.filechat
Demo:
th-cam.com/video/IwKOTgl5HwA/w-d-xo.html
I am getting error as follow
System.NullReferenceException: 'Object reference not set to an instance of an object.'
port was null.
i am also had same error , did you rectify the error
Thanks a lot. Really very useful information. I benefited a lot.
You are most welcome
I got a small problem. How can we change the code Line chart1.invoke()... if my x variable in Arduino has Long Int type?
Arduino sends data to c# application serially in the type of string. You can convert string to long in c# using following code before chart.invoke long lvar = (long)Convert.ToDouble("223.22");
@@swikbymirtahaali i got System.NullReferenceException: 'Object reference not set to an instance of an object.'
i request you to reply
always show port is null
@@sarathkumar-gq8be Check port is available before calling any port function
@@swikbymirtahaali
using System;
using System.IO.Ports;
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.Threading;
namespace chumma
{
public partial class Form1 : Form
{
SerialPort port;
string getval;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
String[] ports = SerialPort.GetPortNames();
foreach (string port in ports)
{
Portlist.Items.Add(port);
}
}
private void BtStart_Click(object sender, EventArgs e)
{
Thread SerialVal;
SerialVal = new Thread(runit);
SerialVal.Start();
port = new SerialPort(Portlist.Text, Convert.ToInt32(baudrate.Text));
port.Open();
}
void runit()
{
while(true)
{
try
{
if (port.IsOpen==true)
{
var date = DateTime.Now.Year + "y-" + DateTime.Now.Month + "m-" + DateTime.Now.Day + "d-" +
DateTime.Now.Hour + "h-" + DateTime.Now.Minute + "m-" + DateTime.Now.Second + "s";
getval = port.ReadLine();
data_tb.AppendText(date + "\t\t\t" + getval);
/* this.Invoke((MethodInvoker)(()=> data_tb.Text, getval);*/
}
}
catch (Exception)
{
port.Open();
}
}
}
}
}
this is my code did you find any error ,kindly notify to me to rectify the error
@@swikbymirtahaali i need your help, please find the code above help me to rectify the error I tried more .
IT was really helpful, Thanks a lot for making this video
I'm so glad!
Ужасный урок. Автор даже не тренировался.