Go Down

Topic: Need advice on implementing a simple counter function (Read 956 times) previous topic - next topic

Hi all,

I have what I hope wont be a terribly deep question. Basically I've got an IR beam set up, and I want to count the number of times the beam is broken over a given period of time.  Im wondering if this can be done using the built in memory on the arduino so that I dont have to leave a computer on logging with serial.print or buy one of the memory card add ons.

Thanks
C

RuggedCircuits

Sure, you can use the on-chip EEPROM. You have 2kbytes of EEPROM to play with and it sounds like you're only going to need 1-2 bytes to keep a counter.

Have a look at the EEPROM library:

http://arduino.cc/en/Reference/EEPROM

--
The Arduino Drum Machine: MIDI development system with 14-track MIDI drum machine sequencer / groove-box software


Go Up