I've had my flashlight freeze once or twice. I think it's due to corrupted firmware. After re-uploading the exact same firmware (absolutely no code modifications) I had no issues.
If you have the problem in the field, you can use the internal button to reset your hexbright (it sounds like you did that).
Most programs turn off the hexbright entirely if they're not active, so it's unlikely that the code turned on the light - unless the light hadn't been turned off since being plugged in? I have seen a bug where the code runs set_light(,0,) even if a button hasn't been pressed, so the program continues to run until it's manually turned on and then off.
If you are using the hexbright library, and your flashlight locks up (and the problem persists after a re-flash), let me know.
the described bug can easily be detected by doing the following:
- Insert a 'set_led(GLED,100)' at the start of loop.
- Upload the code
- Unplug your flashlight (you have not touched the button since uploading)
If the led stays on after being unplugged, at some point set_light(,0,) was run, despite there being no button press.