C# and Microcontrollers
There are plethora of microcontrollers available today. If you want to write your microcontroller code in C#, you have a couple of options.
First lets look at how a standard Arduino works today. Standard Arduinos like the Arduino UNO are programmed from a computer. Once the code is loaded, they are fully autonomous from the computer. The Arduino has it’s own processor and storage, so it doesn’t need the computer to run.
There is an open source IDE for Arduino that runs on your laptop. The code that write is in C. (Technically it is Processing, but it is very close to C.)
There is another board that you can purchase called the Netduino. It is more powerful and more expensive than an Arduino.
The code you write for the Netduino is C# and you use Visual Studio as the IDE. The Netduino has a processor that is powerful enough to run the .Net Micro Framework. So the code you write executes write on the Netduino.
If you want to write C# code that works with an Arduino, you can use the ScriptCS Arduino library. In this case, you write CS code that executes on the computer that controls the Arduino. The Arduino must have a USB connection back to the computer as as the code executes.
You load a program on the Arduino called Firmata. It comes as one of the examples with the Arduino IDE. Once this is done, you can write C# code that executes in ScriptCS. Your C# code sends commands to the Arduino via the USB connection.
Feel free to comment on the post but keep it clean and on topic.comments powered by Disqus
My name is Eric Potter. I have an amazing wife and 5 wonderful children. I am a Microsoft MVP for .Net. I am a software architect for Aptera Software in Ft. Wayne Indiana and an adjunct professor for Indiana Tech. I am a humble toolsmith.
Aptera Blog Posts
Posts I have written for the Aptera Blog: