My skill level, so far, is being able to hookup sensor to Arduino and run example code. The example code displays data in numeric form in Serial Monitor.
Next, I came across a nice C# library, which supposedly displays data in graphical form (I looked at the demo and I liked the way it look and displays data).
I would like to use this library to display my sensor data on screen -- and I have tons of questions.
Source code for the # library is also available online.
I want to use this library with Arduino. Where do I start ?
What changes need to be made to Arduino code to be able to use a C# library ?
Has anybody tried this ? Is there any link or document that I can read to educate myself ?
My problem is how do I interface C# library with Arduino.
Any replies greatly appreciated. Thanks.
The Arduino communicates with the PC using the serial port. Whatever application you have monitoring the serial port read the data sent by the Arduino and does whatever it is supposed to do with it. It doesn't matter to the Arduino if the PC is using that data to print some numbers, to draw some shapes, to ring some bells, or just discards the data.
So, no changes need to be made to the Arduino code.
The C# application might need to be changed to read data from a serial port, rather than, for instance, a file.
There are a few examples of using C# to read data sent to the serial port by the Arduino. Search this forum for an example of sending data to the Arduino, and then reverse that logic to read the data sent by the Arduino, instead.
I've written C# code to read the serial port. It's really pretty simple. I haven't had a need to do anything more than emulate the Arduino Serial Monitor, but capturing the data is the hard part.
Well, I think it's a simple task. First of all you should have a good understanding of c#. Then just look at the dot net framework class called System.IO.Ports, it gives you all you need to talk with arduino. You could start from here for example http://csharp.simpleserial.com/. I've tried it myself successfully.
Thanks all for replies.
Helps me to get starting point.
I guess I need to find a good book on c# to get good understanding of C#.
Any suggestions ?
There are litterally hundreds of good C# books out there.
An important issue to take into consideation is that C# is depending heavily on the .net framework, so just make sure that the book you chose deals at least a little with .net.
This is especially important when dealing with code that uses the serial port, because of the threading model .net uses. It is not difficult, but also not obvious how to handle that if you have little experience with .net.