An I/O controller for virtual pinball machines: accelerometer nudge sensing, analog plunger input, button input encoding, LedWiz compatible output controls, and more.

Dependencies:   mbed FastIO FastPWM USBDevice

Fork of Pinscape_Controller by Mike R

Issue: Enabling night mode enables all outputs (Closed: Fixed)

If I connect the KL25Z and then enable night mode, before it receives any other command, it enables all outputs. The issue is not triggered if it has already received output commands, like if I have been playing for a bit or used the config tool. I'm running latest firmware 2021-06-02 with outputs on three TLC59116 and a 595.

I'm not familiar with the code but from what I have managed to gather it seems as if the outLevel array is not initailized at startup and its undefined content is sent to all outputs in function setNightMode.

Adding "memset(outLevel, 0, numOutputs);" to "initLwOut" function and callinf "allOutputsOff()" from main startup seem to fix the issue .


16 Jul 2021

Thanks for letting me know, and thanks especially for making the effort to track down the root cause. It looks to me like you're exactly right about it - the night mode switcher is assuming that outLevel[] has already been initialized, which isn't the case if you haven't sent any output control commands from the PC at that point. I'll make the change and post an updated binary so that the problem doesn't recur the next time you update.

16 Jul 2021

Should be fixed in the 2016-07-16 build.

16 Jul 2021

Yes, I just installed it and tried it. Thanks!