#include < Wire.h >
#include < EEPROM.h > // Include the library for EEPROM
// Pin Definitions
const int basePin = 2; // Base signal input pin
const int counterResetPin = 4; // Pin to reset the counter (connected to MR)
const int counterMonitorPin = A0; // Pin to monitor the counter (assuming the counter output is connected)
unsigned long counterValue = 0; // Variable to store the counter value
void setup() {
// Initialize pins
pinMode(basePin, INPUT);
pinMode(counterResetPin, OUTPUT);
pinMode(counterMonitorPin, INPUT);
// Initialize Serial Monitor
Serial.begin(9600);
// Initialize EEPROM
Wire.begin();
retrieveCounter(); // Retrieve the stored counter value from EEPROM
}