Need help understanding this line of code please

Is there a kind soul out there that could translate this bit of code for me? I'm new to programming and I did look in the reference in an attempt to interpret this. Still having trouble understanding. Thank you!

digitalWrite(pin, (ctr & (1 << bit)) == (1 << bit) ? HIGH : LOW)

Read this:

if ((ctr & (1 << bit)) == (1 << bit) )
  digitalWrite(pin, HIGH);
else
  digitalWrite(pin, LOW);

Thank you LarryD

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.