How directly control Arduino Uno via serial port from PC program (not Arduino Ge

I'd like to control Arduino board from my program written in c (c#) that sends and receive data via serial port. With no Arduino Genuino program (and serial port monitor) used. Is this possible? or I have to upload sketch to Arduino board, and later on to control only by Arduino Genuino soft?

Don’t know what you mean by this:

Arduino Genuino program (and serial port monitor) used.

What exactly are you trying to accomplish?

You can put an appropriate sketch in the Arduino and control program flow thru the USB/serial port.

Yes.

With no Arduino Genuino program (and serial port monitor) used.

With no program on the Arduino it is going to be tricky to communicate with it, don’t you think ?

You will anyway have a problem when Serial Monitor and your application want to talk to the Arduino at the same time. You also don't have to use Serial Monitor if you don't want to.

But just like you use something like Visual Studio to write a PC application, you need something like the Arduino IDE to write an Arduino application; in this case one that understands what the C# application is 'saying'.

So what is your C# program doing?

I want to control LED strip by Arduino board. So, in Arduino board I want to have predefined effects, that will be switched when data on serial port comes. At the moment I only see, that I have to control it with Arduino Genuine software with serial port monitor. Even this, how can I pass data from my program c# to serial port monitor in Arduino Genuine? How can I incorporate that *.ino program to c#?

For receiving data on the Arduino have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R

Here is point of view that I will try http://www.instructables.com/id/Arduino-Visual-Studio-Serial-Communication/ I understand, that I have to write and send Arduino's soft to motherboard by Arduino Genuine, and later on, close Arduino Genuine and connect again with Visual Studio?

No, you don't have to close the IDE, just make sure that the serial monitor is closed.

You also don't have to start visual studio to run your C# application.

You must also make sure that your C# application has the serial port closed when you try to upload your Arduino application to the Arduino.

Only one program can use the serial port at a time.

Robin2: For receiving data on the Arduino have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R

I see, but that example only works from Arduino Genuine software compiler? And how to migrate it to Visual Studio?

No, that software runs on the Arduino board. So you develop in the Arduino IDE and upload. It only provides a basic framework; you will have to add additional code to implement the desired behaviour (e.g. when the Arduino receives <1,127>, it will switch the first led on with intensity 127).

You can test it all in the IDE and using serial monitor.

Once it works 100% using serial monitor with all the options and bells and whistles that you want, you can start writing your C# application that will e.g.send <1,137>. You do no longer need the Arduino IDE.

This is the easiest approach.

sterretje: No, you don't have to close the IDE, just make sure that the serial monitor is closed.

You also don't have to start visual studio to run your C# application.

You must also make sure that your C# application has the serial port closed when you try to upload your Arduino application to the Arduino.

Only one program can use the serial port at a time.

Of course, I know it :)