#include < EEPROM.h >
// Pin definitions
const int currentSensorPin = A0;
// Calibration parameters for ACS712
const float VREF = 2.5; // Half of the 5V supply for 0A current
const float SENSITIVITY = 0.185; // ACS712 5A variant sensitivity in V/A
// Variables to store previous and current readings
float lastCurrent = 0;
float threshold = 0.1; // Sensitivity threshold to detect direction change
// EEPROM address to store the count
const int eeAddress = 0;
// Variable to store direction change count
int directionChangeCount = 0;
void setup() {
Serial.begin(9600);