Pinball Project

Thank you, Msquare.

loop() gets called continously. Thus the while(1) { ... } construct is totally superflous.

I used while(1) to be able to use break/continue.

I used if statements instead of switch in order to get a new switch - electric switch, that is... - scan as quickly as possible if no swicth was activated in the last scan. Not that I know if it makes any difference since I don't know how long it takes for each instruction to be executed. A switch statement may even be faster than 20 if statements, I don't know.

The brackets around the return value are not needed.

I didn't know that. Thanks again!


The Multiplexer board for scanning the switch matrix is ready now. Just have to restore some connections to the switches on the playfield, some disconnected by previous owner, some hacks made by me when I didn't realize how easy it (hopefully) is to scan a matrix, especially using an Arduino! Then it's time to test if it rellay works, not just in theory. Exciting!