Rotary encoder + 7 segment display.

   if (encoder[1].count = 1)

Comparison is == not =.