I'm trying to make my Arduino Uno board work together with some slightly dated software,
Visual Foxpro 9.0.
I've seen several tutorials explaining how to connect an Arduino board to Foxpro, but I can't understand the process to get both sides to communicate. Anyone know how to do it?
I moved your topic to an appropriate forum category @jacobr92 .
In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.
That's not how it works. Each side runs its own code, entirely unaware of what is on the other side (other than something is supposed to be there). They communicate solely through serial-over-USB.
sketch on Arduino
built-in serial with Serial
form on VFP (the sample code below from that thread you linked)
PUBLIC oForm
oForm = CREATEOBJECT("Form")
oForm.ADDOBJECT("comm", "olecontrol", "MSCommLib.MSComm")
WITH oForm.comm
.CommPort = 1 && Set to your COM port number
.Settings = "9600,N,8,1" && Match baud rate and settings
.PortOpen = .T. && Open the port
ENDWITH
* Send "Hello World" to Arduino
oForm.comm.Output = "Hello World" + CHR(13) + CHR(10)
After assigning a few settings properties, data is sent by assigning to the Output property.
In that case, the bits flow in the other direction. On the Arduino, you'd use Serial.print. In VFP, you apparently read the Input property, either by
constantly polling it
hooking an event that tells you when data arrives
I did not find any official documentation online, but there is a Word doc from the University of Iowa that (at least partially) explains this, and some old forum threads in various places. Relevant properties include
That's sorta like asking how to add a spreadsheet to Excel. It's one of the core functions of the program; are you familiar with it at all?
As a database program, it may not offer a particularly good way to plot data. Have you considered trying to have the Arduino talk to Excel, perhaps using the same MsComm component? There are discussions about that out on the internet as well.
If you intend to store the data, especially in DBF files for whatever reason, then VFP is probably a better choice.
I use Visual Foxpro from some month. nothing to serious.
Can you help me?
I try with Excel data streamer to send the data in a spreasheet. But the problem is create an executable with excel. For me, Visual Foxpro for this things is better.