Thanks for your help.
It ended up being a driver problem. Even though the Arduino software works fine over the usb-serial connection other things did not. I fixed the driver problems and have communication going both ways in Delphi.
Thanks again.
Thanks for your help.
It ended up being a driver problem. Even though the Arduino software works fine over the usb-serial connection other things did not. I fixed the driver problems and have communication going both ways in Delphi.
Thanks again.
I uploaded my code for HyperCos to Google Code. You can browse the code there and download the executable.
HyperCos links the MIT Scratch project to Firmata on the Arduino, allowing the Arduino to be used as a Scratch remote sensor and providing access to the Arduino for output via the Scratch 'broadcast' command.
The HyperCos source is heavily commented with the intention of making it easier to understand for less-experienced programmers.
I have tested digitial IO and analog input. I have not tested PWM output, and it doesn't support servos.
Comments, questions and contributions welcome. In particularly I'd be interested to hear whether anyone has difficulty compiling the project.
Oops, I forgot to include the Scratch project with the download, so I added another download file for it.
Hello all,
I did a copy-paste with the code that LiMiT posted and had to mess with it unsuccessfully for many hours before I found out that Delphi is only able to read Arduino's serial messages when the Arduino has been "contacted" by the Arduino Software Serial Monitor. I mean once I plug in the Duemillanove board by the USB to the computer and read that port with Delphi, I get jibberish, if any at all. The data received via serial port from the Duemillanove is clean and readable only after I've launched the Arduino Serial Monitor in the application developing interface itself. Even if the Serial Monitor is open just for few seconds and then closed again, the Delphi program is able to read serial data sent from the physical board afterwards.
Now. Is the Arduino Serial Monitor sending some sort of initialization data to Arduino board to prepare the actual program data exchange?
Thanks ahead!
For what it's worth, I moved to TComPort instead (available at Sourceforge) and use start/end packets with my serialdata transmitted from Arduino which I process further in my Delphi app.
My personal opinion is that this is easier - even if it means that you need to encapsulate the serial sent from Arduino with your start/end packets.
I found out that Delphi is only able to read Arduino's serial messages when the Arduino has been "contacted" by the Arduino Software Serial Monitor. I mean once I plug in the Duemillanove board by the USB to the computer and read that port with Delphi, I get jibberish, if any at all. The data received via serial port from the Duemillanove is clean and readable only after I've launched the Arduino Serial Monitor in the application developing interface itself.
Sounds like you've got a data rate mismatch of some kind.
Opening a connection with the serial port normally resets the Duemillanove board which would also reset any changes to the serial settings. Do you have that reset disabled on the board?
If you want to send the code for your apps I'll load them up and try them on my setup.
I copied the code, which LiMiT posted in this topic 17 posts ago on 28.08.2009 at 19:29:14
To answer your question then I am not sure if the board has that reset disabled or not, it is probably which ever is the default.
I need to send links, but need to send one post before...
Following I'll send the other posts with the links.
I made one Dimmer-like code...
one for Arduino and one for Lazarus, using 5dpo Serial package. It can be downloaded here: Arduino - Home.
I think you'll need to subscribe to download. Sorry but I had no other place to upload it. If anyone can...
5dpo can be downloaded from 5dpo - Free Pascal wiki and is very easy to use!!!
Hope it helps someone.