What's the best approach to forward data to arduino with BATCH script?

Hi,

Via my pc, multiple events are logged and monitored and i want to forward this data to arduino.
i've got a mega 2560 built-in in my pc and hooked onto it by usb. Since i don't have experience in pc programming languages, i just use batch script to get the job done.
What's the best (and hopefully the simplest) approach to get the data to arduino this way, so through batch script? I suppose an additional layer is needed to get this done, but i wouldn't know what or how.

Thanks for the help.

A batch script may not be a simple way to send data to your Mega. When a PC program opens the serial port it causes the Mega to reset and that must be allowed for. It would be much easier to do that with a "proper" PC program.

Have a look at this Python - Arduino demo. If you put in the correct serial port reference I think it will work on Windows. It would be easy to adapt it to take data from a PC file and send it to the Arduino.

...R

Robin2:
Have a look at this Python - Arduino demo. If you put in the correct serial port reference I think it will work on Windows. It would be easy to adapt it to take data from a PC file and send it to the Arduino.

Thanks, i've stumbled upon that thread before, but i couldn't figure out how to modify it properly to get it to do what i described in my post. "It would be easy to adapt it(...)" but not for a noob like me.. :s

I figured so much that the 80 in "/dev/ttyS80" in your script should be changed to the com port that arduino is using, but i couldn't come any further. I guess testData.append(); is used to send to arduino, but i'm not sure.

The only thing i need is that the python script sends, for example, a temperature to arduino.
I can figure how to get data from a logfile in a var in python, but i wouldn't know how to get it to arduino and put it in a var there.

I don't need the led and servo part, but i don't know what to strip from the code and what is still necessary for the script to work properly. If you could help me with this, i'd be really thankful.

What's the best (and hopefully the simplest) approach to get the data to arduino this way, so through batch script?

You can use a resistor or capacitor on the reset pin to keep it high to prevent the arduino auto reset when using batch files on windows.

TR_7:
I figured so much that the 80 in "/dev/ttyS80" in your script should be changed to the com port that arduino is using, but i couldn't come any further.

The whole of "/dev/ttyS80" has to be replaced with the Windows equivalent - probaly "COMxx", but I am no good on Windows stuff.

If you are not good at programming then what @zoomkat suggested may be a solution.

...R

zoomkat:
You can use a resistor or capacitor on the reset pin to keep it high to prevent the arduino auto reset when using batch files on windows.

Thanks!
If that would get the arduino not to reset, and receive messages that are thrown at it from the pc, i'd be fine with that solution. Could you maybe explain how i would get a python/batch/.. script to send data to arduino?
Like echo var > COM3 or something?

TR_7:
Could you maybe explain how i would get a python/batch/.. script to send data to arduino?

This is the Arduino forum. Not the Python Forum or the BatchFile Forum.

I think you need to do some basic study about programming.

...R