reset when serial unavailable?

Hi all:

I've written a stationery bicycle computer app that processes my reed switch data, and then sends a stream of data to a Processing app for display.

I've noticed that whenever I stop and/or restart my Processing app, the total ride-time as calculated by my Arduino resets itself. Does this have something to do with the serial connection being reset?

Is there a way I can make Arduino keep running its program regardless of whether or not Processing is listening on the other end?

Thanks
Adam

When you say serial, do you mean through the USB cable, or the rx-tx pins?
I've noticed the resetting behaviour on the USB cable (when also having the arduino powered through an external supply), but not when using a serial device on the rx-tx pins (bluetooth for instance).

Hm, interesting. Yes, I'm using USB. Ideally I'd like to be able to connect the device to USB to "upload" my ride, but then have the freedom to disconnect, go for a ride, and then plug it back in again. Is that possible?

There are ways to disable the auto-reset feature. Search the forum for auto-reset.

There are drawbacks to doing this. You'll have to decide whether they outweigh the benefits, or not.

You could log data to an SD card, which could then be removed for copying, without causing the Arduino to reset.

Thanks, Paul. I didn't know the term was "auto-reset", so that will help!

The SD card option is a good one, except that then I can't do live data plotting when riding stationary. I'm hoping to set it up so that I can go for rides outdoors if I want to, but also ride in-place with a big graphical display if I prefer.

The solution of disabling auto-reset is good.

A free alternative to SD is to use the on board EEPROM.
You could stash values away in there, and pick up where it leaves off. You could even switch the power off.
You would have to figure out when to store, but you'd have the same problem with SD.

There is a little library to use it

It only has 512 bytes, but probably enough.

HTH
GB

I think there are versions of the Arduino out there that have switches/jumpers to allow you to enable/disable the auto-reset functionality; while you could likely mod a standard Arduino to disable the auto-reset, or hack in such a reversible mod, it might be better to track down a board with it already built in (probably something from Seeedstudio)...

Ah - here it is (out of stock, tho):

http://www.seeedstudio.com/depot/seeeduino-v328-fully-assembledatmega-328-p-439.html?cPath=27