Interfacing with Arduino from C# - Multithreaded Example Project.

I’ve recently started playing with my Arduino and put together this C# Windows project in Visual Studio 2010 to drive and test the device.

The project demonstrates how to use C# to communicate with the Arduino via a seperate thread in order to not block the main form.

In addition to illustrating how to interface with the Arduino from a C# program, it demonstrates the ability for using multiple threads to :
1.) Asynchronously buffer serial output to the Arduino so as to not block the windows form during transmission
2.) Create another, seperate thread for “driving load” or sending random RGB values to the Arduino.

The Arduino software and hardware setup are extremely simple, please run the app for detailed config. Essentially, it combines these configurations to change the power of the RGB LEDs as a result of interaction with the Windows FORM. The LCD, though not required, is interesting for showing the input from the Windows program to the Arduino

zipfile attached. Also available here:!3764&parid=512082F83734C3B6!3763

Let me know what you think.

By the way…

I wrote my own serial port interface, but later found this, which is a more robust implementation.
SerialPort (RS-232 Serial COM Port) in C# .NET : (731 KB)

file error vs c# 2012. you try vs c# 2010