Pages: [1]   Go Down
Author Topic: Referencing Arduino sketch in Visual Studio  (Read 1223 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* Screenshot (66).png (112.71 KB, 1366x768 - viewed 29 times.)
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 613
Posts: 49250
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 613
Posts: 49250
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: