is it possible ti use C# to program the Arduino bo

I am been looking with almost no luck for a way to create the code that will run on the Arduinos using C# or any other .NET languages. The idea is to teach C# using Arduino has a tool to visualize the results

Thank you in advance

You can not program Arduino with the .NET languages.

But Arduino is programmed in c (++) so the difference is not that big.

You can create c# programs on the PC side that can communicate with Arduino, but the Arduino software has to be made in Arduinos environment.

However, you can use C# as a front end for the computer side, so if you want to teach them how to intepreting the data from Arduino, then and send out response with a C# front end, then I think it is a good excercise – many microcontrollers are limited to assembly language, plus either Java, basic, or C++.

arduino uses the gcc compiler. There does not exist a c# compiler for the atmega microcontroller yet. Not even the full feature set of C++ is supported by this hardware platform, because object oriented programming languages require more ressources than current simple eight bit mcus do offer. So programming the Arduino hardware with C# is not an option.

Programming a GUI that communicates with an Arduino is something different and it makes sense. You can even think about a WebService that runs on the Arduino (with an Ethernet shield) and integrate this WebService into your Visual Studio. I did this for different embedded systems platforms. This makes the Arduino feel as a part of the .NET environment. For example you could write a WebService that controls 8 digital I/O ports and use it in a C# program. Maybe have a look into the Microsoft Robotics Studio and see how they do the hardware abstraction.

Or as mentioned before, you can use simple serial communication.

I'm trying to do a small application using C# to control Arduino too. I was able to do it via processing but unfortunately i'm unable to get it done on C# because i've never used it before..anybody can tell me if they have a small sample code that can send commands to arduino as a GUI to let's say turn an LED on or off.. i know it's easy for you Arduino wizards and you can write it prob in less than 3min but for us newbies it's a nightmare...i have been trying it's been 4 days now and still no luck :-[

if you have it in C++,java, or similar software feel free to share as the logic remains the same ...i will only have to translate it hopefully

Well, there is a VB.NET port I beleive called Firmata? I don't see why not anyway, because it all gets compiled into machine code when you're done anyway... it would be hard to do though at anyrate... perhaps you could make a library containing inline ASM for each of the methods... or, make C# libraries that send their results over serial for the arduino to show it, as opposed to programming in C# in the first place...

If you wan't to do something like this it would be easier just to learn C++/C, the gap is fairly small, once you let go of those comforting libraries and deep dotting so to speak...

I have a C# application that talks to the Arduino. I used your e-mail link, and sent you a copy.

thanks!