logFile.print(BeeCounterA);
logFile.print(", ");
logFile.println(BeeCounterB);
logFile.println(dateTimeString);
Two values on one record, then the time on the next. Why is that?
That little tiny picture is unreadable. Copying and pasting the text would be a much better idea.
A little snipping is going to happen
if (CurrentSensorStateA != PreviousSensorStateA)
{
// if the state has changed, increment the counter for bees
if (CurrentSensorStateA == HIGH && millis() - lastEvent > interval)
{
BeeCounterA++;
}
if (CurrentSensorStateB != PreviousSensorStateB)
{
// if the state has changed, increment the counter for bees
if (CurrentSensorStateB == HIGH && millis() - lastEvent > interval)
{
BeeCounterB++;
}
}
}
You only care about whether the state of sensor B has changed IF the state of sensor A has also changed.
The likelihood of that happening seems pretty remote. The if(CurrentSensorStateB != PreviousSensorStateB) statement and block does not belong inside the if(CurrentSensorStateA != PreviousSensorStateA) block.