at first I'll post the needed code.
#define STRING_LEFT "05000858FB"
#define STRING_RIGHT "05000B3E45"
#define STRING_LENGTH_MAX 16
char stringname[STRING_LENGTH_MAX+1];
if(strcmp(stringname, STRING_LEFT)==0)
{
// do stuff A here
}
else if(strcmp(stringname, STRING_RIGHT)==0)
{
// do stuff B here
}
stringname is triggered via a sensor that transfers a hexadecimal value and needs to be compared with STRING_LEFT and STRING_RIGHT followed by different actions. When stringname and STRING_LEFT are equal (==0) it does stuff A. If I activate STRING_RIGHT the next time, it does again stuff A. When I use RIGHT a second time, it does B. If I use LEFT again, it does B, a second time A. So the function is always like 'one-event-behind'....and I don't want to have that. How can I avoid this?
TIA