Page 1 of 1

LockCode - Protect your NXT at startup

Posted: 05 May 2012, 05:16
by bungeshea
Ever wanted to protect your NXT from a pesky brother or sister?

When you startup your NXT, instead of showing the startup animation, it will prompt for a four digit code. The code must be entered correctly before you can access your NXT. If you enter the wrong code, the NXT will flash a message, otherwise, the program will end, allowing you to access your NXT. The dark grey button will turn off the NXT instead of ending the program.

If you use the enhanced NBC/NXC firmware, the dark grey exit button will not simple exit the program, instead it will turn off the NXT. LockCode can be used without the enhanced firmware, but this functionality will be disabled, decreasing the usefulness of this program.

The first time the program is run it will ask you to set a code. If you forget the code and want to set a new one, simply delete the file LockCode.dat from the NXT using something like NeXT Explorer or NeXT Commander. There is also a program included, Delete Code.nxc, that will do the same.

Browse the source on GitHub

Attachment removed - download from GitHub instead

Re: LockCode - Protect your NXT at startup

Posted: 05 May 2012, 16:50
by mattallen37
Interesting idea, but it seems kinda pointless. They could just connect to the computer and remote-stop the program.

And just as a warning, you shouldn't let the NXT be turned of until it's been on for at least 10 seconds. If you mistakenly invert your exit-button logic, as soon as the NXT turns on it could power right back off, locking the brick (which I have been able to recover it from, but it's hard).

Very cool though!

Re: LockCode - Protect your NXT at startup

Posted: 06 May 2012, 03:45
by bungeshea
mattallen37 wrote:Interesting idea, but it seems kinda pointless. They could just connect to the computer and remote-stop the program.
I know, but it's really just to stop someone from picking up your NXT and fiddling around with it .
mattallen37 wrote:And just as a warning, you shouldn't let the NXT be turned of until it's been on for at least 10 seconds.
Thanks, I wasn't aware of that. I've uploaded LockCode 1.0.1 which should stop someone from turning off the NXT until at least 10 seconds have passed.