Pages: [1]   Go Down
Author Topic: Need advice on implementing a simple counter function  (Read 765 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Faraday Member
**
Karma: 13
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great, Ill check it out.

Thanks!
Logged

Pages: [1]   Go Up
Jump to: