Go Down

Topic: Link to a good c# example (Read 1 time) previous topic - next topic

PGT

I've been trying to get windows form based serial reader working under C# for almost a week now.
The point is things in forms work a bit different then under 'dos' consoles.
And besides that some older code samples wont work under C# 2010 / 2008

i found this link http://csharp.simpleserial.com/
which (after one adjusts the com port) finally works


Could someone please add the link introduction page of C# and Arduino ?

So other people will wont struggle  like me, and spend way to much time to get it working (if ever).
Its kinda hard to do under C#, to do it right, since under C# its hard to do asynchronous events.
Especially if you just started C# (or even if used it for quite a while, its a very complex topic).
(reminder good c# is totally event driven). The code on that hyperlink is a very good.
No its an EXTREME good example of how it should be programmed.

Good samples are hard to find, i've seen samples who do things wrong or even override system routines
for what they think is better, it is not required this sample proves C# has no bugs for com communication.




PaulS

Quote
Its kinda hard to do under C#, to do it right, since under C# its hard to do asynchronous events.

I found it extremely simple to read and write serial data. Doing so asynchronously simply requires a separate thread to make it work, which was pretty simple to add.

Quote
Especially if you just started C#

Well, that makes a big difference.

Quote
reminder good c# is totally event driven

Even bad C# is, too.

Go Up