Programming. HELP!

How do I migrate the Arduino(with sensor coding) to C# programming?

Not easily, I suspect.

If you want to write a c# program and run it on the arduino, you would need to find a compiler to do that, that is, generate arduino machine code from c# source.

Why do you need to do this ?

What sensor, what code and how will the sensor be connected to the PC.

I am not sure how to interrupt your post. My guesses are

  1. You want to write a program for the arduino using c#
  2. You want to write a PC program that receives data from the arduino and that data comes from a sensor.
    In future reference it is best to ask more specific questions. Also describe the goal not the problem (or in addition to the problem). Sometimes there are better ways to accomplish your goal. Assuming interpretation one: Do you think c# has a chance of running on a 16mhz 8bit processor like the arduino uno or arduino mega. Also which arduino? I do not know much about c# but is sounds as though you want to use .NET Micro Framework? If you want to write a program for the arduino use the ardunio ide and program or do as I do and just use avr-gcc directly skipping the IDE and extra preprocessor. Either way you will be programming in C (or c++). The arduino IDE uses avr-gcc but you cannot control compiler settings and it applies some preprocessing before sending to to avr-gcc. As for interpretation two that is more feasible just send data over uart and the receive the data in your program it is not hard.

i am migrating the arduino code to c#. this is for my school project. Thanks btw! :smiley:

Can you be more specific. What do you mean by migrate? Are you saying you want to write a program that runs on the arduino using c#? I cannot help you unless you do a better job explaining what you are trying to do.

Yes. I want to write a program that runs on the arduino using c#.

963852741:
Yes. I want to write a program that runs on the arduino using c#.

That is a goal that is way beyond me and probably 95% of the people who use this forum.
You would be better off trying to convert the C# to C++ that the Arduino compiler uses or getting a Netduino that you can write C# code for.