The last posted code contains:
if (logFile)
{
logFile.print(buttonBeeCounterA);
logFile.print(",");
logFile.println(buttonBeeCounterB);
Serial.print(buttonBeeCounterA);
Serial.print(",");
Serial.println(buttonBeeCounterB);
}
inside an if test:
if (beeCounterA != lastBeeCounterA)
It's hard to tell whether you have a similar prevBeeCounterB, or not. You would need one.
The variable names used in this application are terrible. I look at a name like buttonBeeCounterA and I think of a pin that a switch is connected to. I can't imagine why writing a pin number to the output file is of any interest.
I think that the best thing, at this point, is for you to post all of your code.
Changing the whether to log code is easy:
if (beeCounterA != lastBeeCounterA || beeCoutnerB != lastBeeCounterB)
In the code to actually log data:
if(beeCounterA != lastBeeCounterA)
{
logFile.print(buttonBeeCounterA);
}
logFile.print(",");
if(beeCoutnerB != lastBeeCounterB)
{
logFile.print(buttonBeeCounterB);
}
But, like I said, I can't tell that the correct stuff is being tested, or that the correct stiff is being written to the file, since the names are horrible.