Go Down

Topic: Referencing Arduino sketch in Visual Studio (Read 1 time) previous topic - next topic

fred2028

I have a solution in Visual Studio 2012 that includes the Arduino sketch (using VisualMicro) and a WPF C# application. How can I refer to and call methods from the Arduino sketch project from my WPF C# project in Visual Studio? So far, they are under the same solution and the Arduino project is a dependency of the C# project. However, I cannot call the loop() function from my C# project and compiling my solution does not compile the Arduino project.

Thanks.

PaulS

Quote
How can I refer to and call methods from the Arduino sketch project from my WPF C# project in Visual Studio?

Just like you'd call functions on my computer. The answer is that you can't. The Arduino, in case you haven't figured that out yet, is a separate computer. It just happens to be programmed using the same PC that the C# code is being developed on.


fred2028

Oh OK, darn. What would you recommend me to look at if I want my C# project (Kinect) to communicate live with the Arduino?

PaulS

Quote
What would you recommend me to look at if I want my C# project (Kinect) to communicate live with the Arduino?

The same thing I recommended last time you asked. You need to send the Arduino messages. It needs to parse, understand, and implement the messages. A protocol is an agreed upon set of messages - The C# application is then restricted to sending only those messages, and can expect to get a reply in a known format. The Arduino is then able to deal with a known set of messages, in a known way.

Start by making a list of the things that the C# application might expect the Arduino to do. Don't worry about coming up with a message format, yet. Just list the tasks that the C# application needs the Arduino to perform.

Go Up