PDA

View Full Version : Reset Command Available?



JBWolf
11-16-2011, 10:42 AM
Hello,
I was wondering if there is a spin command to reset the propeller? I'd like to accomplish same effect as pushing the reset button or powercycling.
I'm hoping for an easy way to make my program restart if a combination of input buttons are held down for a period of time.

Thanx,
J

JBWolf
11-16-2011, 10:52 AM
Ah, just found the REBOOT command.
Looks like syntax is used just like QUIT, by itself correct?

for example:
if ina[button] == 1
reboot

JonnyMac
11-16-2011, 02:53 PM
Yes, all by itself -- I use it after having the Propeller reload new firmware from an SD card.

That said, your code above is a tad dangerous; a bit of noise on the board could cause the input to read as "1" and reset the program when you don't mean it to. You might want to add a simple debouce loop.