Light Rotation on 7 Segment LED

In one of my PIC lab, I asked the students tried to circulate the lights (of two lines) on 7 segment LED. That is, A-B, B-C, …. F-G, G-A, and A-B again. However, I found it looked ugly and I asked them to make the circulation without going through the segment G.

Rotation of lights from AB to BC, …., EF and FA (without go through G).

If I were to write this in C programming, it will be something like these:
//...
// Somewhere after "rlnc PORTD" -- the rotation of 7 segments lines.
// ...
if (PORTD == 0b01100000){
PORTD = 0b00000011;
}
// ...

That is, if it was the lines of G-A, then change it to A-B.

Continue reading “Light Rotation on 7 Segment LED”