Do you really understand the concept of what compiling actually does. It converts the source code (written in an upper level language) to binary code to be executed on a specific platform.
A DLL is a binary file compiled to run under WINDOWS. ALL of it's functionality has to use the windows api. Getting user input, showing output, getting data from other devices. EVERYTHING in a dll has to go through the windows.
The only way a dll will work on an arduino is if you were to install windows on the arduino first. Not only has the arduino insufficient resources to have windows installed, but the source files for windows would have to be recompiled to run on this new hardware platform. Obviously that's never going to happen.
So I just wonder, why would you want to create a dll from an arduino library?
I don't think you understand what I'm trying to accomplish. I'm trying to communicate with the arduino through C#. This can be done through calls with the Serial class.
I thought any C++ program could be compiled into a DLL.
I'm not trying to install windows on the arduino, more like store all of the arduino library in a DLL so i can call it from a C# program.
I'm trying to communicate with the arduino through C#. This can be done through calls with the Serial class.
Yes, it can. So, what, exactly, do you plan to write to the serial port?
I thought any C++ program could be compiled into a DLL.
Where, exactly, do you expect to dynamically link to this library from? The code in the file you referred to has no practical use on the PC, and you can't use a DLL on the Arduino.
I'm not trying to install windows on the arduino
Good thing, since it doesn't have a DVD reader.
more like store all of the arduino library in a DLL so i can call it from a C# program.
Why do you think that will work? What is calling a function in the DLL going to accomplish, if you do manage to get the DLL built?
rjg88:
I don't think you understand what I'm trying to accomplish. I'm trying to communicate with the arduino through C#. This can be done through calls with the Serial class.
EXACTLY! So use calls to WINDOWS serial API within your c# application.
The Python code should run under Windows if you make the correct reference to the COM port the Arduino is connected to.
You should be able to write a C# program that does the same job as the Python program and communicates with the unchanged Arduino script. That would be a good learning exercise as you can be sure the Arduino code works properly.
You can also communicate with the Arduino code using the Arduino IDE.
I hope you get the idea from all this that whatever code is used in the PC has nothing in common with the code on the Arduino - they just need to be able to talk to each other.
junior700:
This is a dll that you can use with your C, C++ and C# application. This one acess serial COM ports COM3 to COM9. I use on my windows C++ application.
After 3 and a half years I doubt that the OP will be interested