mip->atmin = (newpos <= mip->min); I dont understand this stmt.

It's the use of the <= within the parens.
I always thought that <= would be used in an if statement meaning less than or equal.
Apparently not as shown in this sketch.
I have tried to find my answer in the Arduino reference manual but dont know what to look for.
It doesn't seem to be a structure or an array but I could be wrong.

It assigns either true or false to mip->atmin

It's a shortcut for:

if (newpos <= mip->min)
{
  mip->atmin = true;
}
else
{
  mip->atmin = false;
}

guix:
It assigns either true or false to mip->atmin

It's a shortcut for:

if (newpos <= mip->min)

{
  mip->atmin = true;
}
else
{
  mip->atmin = false;
}

Thank you guix. I hate these shortcuts.

hextejas:
Thank you guix. I hate these shortcuts.

I hate over-long code.

This does the same:

mip->atmin = (newpos <= mip->min);

EDIT: Kicking my head, LOL! :smiley:

TheMemberFormerlyKnownAsAWOL:
I hate over-long code.

I hate code that is difficult to follow, unclear, uncommented, etc.
When writing the original code, please have pity on the dude that might have to maintain it.
Make it as clear as possible.

I'll get off the soap box now.

hextejas:
I hate code that is difficult to follow, unclear, uncommented, etc.
When writing the original code, please have pity on the dude that might have to maintain it.

That depends on the skill set of the person reading / maintaining the code. The line you posted is perfectly understandable and maintainable by an experienced programmer. The issue of maintainability really has to do with the larger code structure and organization.