LEDs Puzzle
technoblogy.com
technoblogy.com
Actually the 14 pin chips provide 12 GPIO lines, it just requires you to set a fuse which will disable the reset function to get the 12th one.
If you then need to change the programming once more after setting that fuse, you'll need what is known as a "high voltage programmer" (high voltage being 12V instead of 5V) to regain access to the reset pin.
_ A _ B
C _ D _
_ E _ F
B _ G _
If we denote the corresponding buttons in lowercase, we have the equation A 1 0 1 1 0 1 0 a
B 0 1 0 1 1 0 0 b
C 1 0 1 0 1 0 1 c
D = 1 1 0 1 1 1 0 d
E 0 1 1 1 1 0 1 e
F 1 0 0 1 0 1 1 f
G 0 0 1 0 1 1 1 g
Where A=1 if and only if light A needs to change.This matrix over GF(2) is not invertible; its rank is only 5, so the lights cannot be changed arbitrarily. By Gaussian elimination, one finds that button f does the same as buttons a b e together, and button g the same as b c d together. This reduces the equation to
A 0 1 1 1 1 a
B 0 1 0 1 1 b
C = 1 1 0 1 1 c
D 0 0 0 1 0 d
E 0 0 0 0 1 e
and the solution comes out as e = E
d = D
c = A B
b = B D E
a = B C
Solving for the remaining buttons yields e = E
d = D
c = A B
b = B D E
a = B C> This reduces the equation to
We instead just ignore buttons f and g, and invert the equation
A 1 0 1 1 0 a
B 0 1 0 1 1 b
C = 1 0 1 0 1 c
D 1 1 0 1 1 d
E 0 1 1 1 1 e
to a 0 1 0 1 0 A
b 1 1 1 0 0 B
c = 0 1 0 0 1 C
d 1 0 0 1 1 D
e 0 0 1 1 1 E
Showing which buttons to press in terms of exclusive-or of wrong lights, e.g. press button a if exactly one of lights B and D is wrong.They seem to be rare. I have one from a garage sale, years ago. Maybe I should check that the batteries in it haven't leaked, and not let the kids destroy it.