Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic sketches as dll's? (Read 7035 times)
GregC
Newbies
*
Offline


Posts: 2
Location: Easton, Maryland USA
Joined: Jan 19th, 2014
sketches as dll's?
Jan 19th, 2014 at 8:30pm
Print Post  
Hey!  I've been a VS programmer for several years, but am new to the micro-controller world.  I'm currently working with an Uno with a fingerprint scanner attached.  I want to create a Windows app that will communicate serially with the scanner through the Uno.  I'm thinking a VB GUI with c++ dll's to handle the communication between computer, Uno and scanner.  Can I compile Arduino sketches as dll's?  Is there a better way?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: sketches as dll's?
Reply #1 - Jan 20th, 2014 at 2:30am
Print Post  
Hi Greg,

Not sure I fully understand but there are lots of examples on the arduino playground and stackoverlow etc.

I'll add a few quick tips if I understand correctly.

1)

The Arduino code doesn't compile into a windows dll and is always uploaded to the Arduino processor via usb or some other means. The arduino code is capable of sending and receiving Serial.

2)

I expect the scanner is connected to some arduino pins and has a library or some sample code. In that case you can combine the reading and printing of serial on the arduino with the scanner code.

3)

The Vb windows app can use the System.IO name space to read or write to a windows serial port. So your vb app can show UI controls, buttons etc and can forward the commands via a SerialPort such as COM1 at an agreed baud/speed defined in your sketch when you issue a Serial.begin(baudRate) in your arduino code.

Remember that the debugger uses the serial port, this might not be relevant but if it is then post a question and I will point you to a solution.

I hope this helps, there are tons of examples out these for the .NET SerialPort class. You don't need C++ on the windows side of things unless you need pin level port control. 
  
Back to top
WWW  
IP Logged
 
GregC
Newbies
*
Offline


Posts: 2
Location: Easton, Maryland USA
Joined: Jan 19th, 2014
Re: sketches as dll's?
Reply #2 - Jan 20th, 2014 at 12:50pm
Print Post  
Thanks, Tim.  Your comments are on target and helpful.  You've given me a different way of approaching this project.  The fingerprint scanner has several different modes of operation: 
*enrolling a new finger in its database
*verifying a finger against that database
*receiving and sending data over the serial line
just to name a few.
You are correct, there are lots of code samples to perform these individual operations.  My original approach was to try to download the particular operation I needed at the time, as a sketch, and continuously download different operation sketches as needed, via the vb ui.  However, it may be better if I combine all the needed operations as functions in one larger sketch and download only once.  Then call each function from my vb ui.  This will eliminate the need for dll's or any other code libraries stored on the computer.  Do you agree that this is a better approach?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: sketches as dll's?
Reply #3 - Jan 20th, 2014 at 1:12pm
Print Post  
Hi, Yes that makes good sense to me.

Best of luck
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint