I started a devellopment of GUI (delphi) for interfacing with Arduino. I would like to know the solution to detect the connection & deconnection of arduino (HID/PID/VID ?) And secondly, how communicate with arduino to send and receive informations (ASCII) via USB connection (not RX/TX canal)?
All of that in DELPHI language.
Some examples are welcome.
There is really no USB connection. The USB plug on the Arduino board is a serial port. This serial port is also connected to the RX / TX pins (pin 0 and 1).
On the Arduino Board there is a FTDI chip that does the conversion from serial to USB.
When you install the Arduino software on your PC a driver for the FTDI chip is installed on the PC, this driver creates a virtual COM (serial) port. This port is what you use to communicate between the PC and Arduino.
I have done some work with this type of problem in the past.
some comments:
1st: The arduino appears to be a com/serial port. Using the commands available to you, find all available com ports in the system. The com port disappears when you unplug, reappears when you plug in.
2nd: Try to open each com port. If it is already open, it might be a serial mouse or some other device.
3rd: When trying to open the com ports, start with the highest com port and work backwards down to com1. The arduino is most likely the highest available com port.
4rd: if you want to get really fancy, once you have successfully opened a comport, send a command-byte to the arduino that will cause it to respond... and have your windows program verify that the response was proper.
I did the above for a Radio controller and it works 100% of the time.
Hi,
If I understand, The USB port in Arduino must be used like a serial RS232 port in a computer application (D ELPHI, ie).
This constatation brings another question :
If we need send informations to arduino and receive informations in computer (GUI in d elphi), the inputs 0 and 1 are dedicated at this communication, so we remain only 12 digital inputs, even if we are connected in USB port.
Could you confirm that ?
thank you in advance for your answer.
If you want more I/O there are ways of extending or multiplexing the I/O you have to an almost unlimited number. See the playground tutorials for details.
If you want more I/O there are ways of extending or multiplexing the I/O you have to an almost unlimited number. See the playground tutorials for details.
The six analog pins can be used as digital input or outputs, so the total (excluding the two used for USB) can be up to 18 before extending or multiplexing is required.