I've received my Arduino Uno and started a C# project to communicate with it. I'm using Arduino IDE plugin for visual studio, then I can have every projects into the same visual studio solution..
I managed to send and receive some data thanks to exemples but now I want Arduino sketch to use some object of my C# class library. I don't find the way to declare and use the objects into sketch program.
What I have for now:
BoxControl_Common Assembly:
namespace BoxControl_Common.Service.Arduino
{
public enum ArduinoServiceRequest
{
SayHello = 1,
SayHelloYou = 2
}
public class ArduinoServiceResponse
{
public static string BadRequest = "BAD REQUEST";
public static string Hello = "HELLO";
public static string HelloYou = "HELLO YOU!";
//....
}
}
It doesn't support .net class library? I was able to reference the c# library in the arduino sketch project, but can't find any way to use the classes in the sketch (since i'm too noob in c++ stuff).
Maybe the opposite is possible? Make a c++ library which is referenced in my c# projects?
Any way to share classes between arduino sketch and c# projects?
Ok Its not really important, I'm just trying to figure out the possibilities. It'd have been great to be able to have kind of communication contract between c# application and arduino sketch.
Since yesterday I'm looking for solutions, I always think it will work but well.. it doesn't. I'm too noobish with C++ to figure out why. That's frustrating!
Could you explain to me why this topic can't help?
-N4w4k-:
Could you explain to me why this topic can't help?
On the standard Arduino there are no DLLs at all, no dynamic linking,
it is even uncommon to use non-dynamic libraries.
Libraries in Arduino context more or less compare to 'sourcecode for library-members'
that get compiled and linked on demand.
In general, in order to communicate data between very different environments (C# on x86 windows vs C++ on AVR Arduino, for example), you need to carefully define some sort of "extern data representation" that is a least-common-denominator that can be easily interpreted by both. This is the sort of thing that makes computer networking such an "interesting" field; you want your IBM Mainframe 4 8-bit EBCDIC characters in a 32bit word fixed record text files to show up on your DEC 5 7-bit ASCII characters in a 36bit word newline-delimited text files are actually look right... (ok, that particular example might be a bit dated...)
See the Internet RFCs and their carefully defined packet formats for some good examples.
See the CCITT OSI protocol specs for some bad examples