I had an extra PicAxe-18X after doing a recent project for a coin display for my arcade machine, since I didn't blow up the first chip.
I decided to build the Magic Switchboard (Magic SwitchBox) using the spare chip and after taking the code that Technical put up in another thread, and making some substantial changes, I'm now ready to post photos, schematics and code and explain some of the changes.
I changed the input and output pins required in the code so it would be easier to wire the circuit. The inputs are 1, 0, 7, 6 (in that order for switches 1-4). The outputs are 7, 6, 5, 4 (in that order for lights 1-4).
I also added a tweak that allows the timeout to function even if all switches have not been learned. This allows it to reset itself if an audience member flips a switch out of sequence (which has already happened to me!). I just explain that the person just doesn't have the magic and then just flip the switch off to let it reset.
I've added a multi-bulb/direction feature. If switch-1 is the last turned off, it acts like it normally did before, bulb-1 thru bulb-4 in sequence. If switch 2, 3 or 4 is turned off last, it will start in that position instead. Odd bulb starts will sequence left to right. Even bulb starts will sequence right to left. This means if I turn switch 2 off last, the next reset will be in the order of 2,1,4,3. If switch 3 is switched off last the next order will be 3,4,1,2. If the 4th switch is turned off last, the order will be 4,3,2,1.
The woodworking still needs work - I need to clean up the sides (sand them smooth) and try to find some 2 inch wide veneer edging tape to apply to the sides (to cover the seams of the multiple layers of wood). Then I will sand the corners smooth and stain the board, finally applying a urethane coating.
The switch caps are 1 inch sections of quarter-inch dowel that I rounded on one end, and drilled a hole in the other end. I painted the bulbs and the switch caps with the same glass stain, which I bought at a local craft store. The stain is intended for "Stained Glass Suncatchers".
I decided to build the Magic Switchboard (Magic SwitchBox) using the spare chip and after taking the code that Technical put up in another thread, and making some substantial changes, I'm now ready to post photos, schematics and code and explain some of the changes.
I changed the input and output pins required in the code so it would be easier to wire the circuit. The inputs are 1, 0, 7, 6 (in that order for switches 1-4). The outputs are 7, 6, 5, 4 (in that order for lights 1-4).
I also added a tweak that allows the timeout to function even if all switches have not been learned. This allows it to reset itself if an audience member flips a switch out of sequence (which has already happened to me!). I just explain that the person just doesn't have the magic and then just flip the switch off to let it reset.
I've added a multi-bulb/direction feature. If switch-1 is the last turned off, it acts like it normally did before, bulb-1 thru bulb-4 in sequence. If switch 2, 3 or 4 is turned off last, it will start in that position instead. Odd bulb starts will sequence left to right. Even bulb starts will sequence right to left. This means if I turn switch 2 off last, the next reset will be in the order of 2,1,4,3. If switch 3 is switched off last the next order will be 3,4,1,2. If the 4th switch is turned off last, the order will be 4,3,2,1.
The woodworking still needs work - I need to clean up the sides (sand them smooth) and try to find some 2 inch wide veneer edging tape to apply to the sides (to cover the seams of the multiple layers of wood). Then I will sand the corners smooth and stain the board, finally applying a urethane coating.
The switch caps are 1 inch sections of quarter-inch dowel that I rounded on one end, and drilled a hole in the other end. I painted the bulbs and the switch caps with the same glass stain, which I bought at a local craft store. The stain is intended for "Stained Glass Suncatchers".
Last edited: