Snippet - Button/Software Main Board Hard and Soft Reboot

[title]Button/Software Main Board Hard and Soft Reboot[/title]
I often use a programmable button press event in my C# code. I tried this on my new FezSpider and it works!

I have a small test program you can try so you can see if it is something you can use in your applications.
In the sample code I use the programmable button press event to ‘software press’ two buttons that cause a soft or hard reeboot. You will need a terminal connected to the FezSpider to see the application output and to type “soft” or “hard” to cause the button events.

Note: The code used for the software button press can be modified and used to call almost any function in your code…

I use a soft and hard reboot but I have to admit that I have absolutely no idea what the difference is as far as how the FezSpider reacts to either event. All I know is that it reboots.

If anybody knows what the difference is between a hard and soft reboot, I sure would like to know.

Have Fun!

Try to eliminate Thread.Sleep() from your code by using a timer especially that your sleep periods are quite long.

Thank you for the info about using a timer.

I just wanted to keep the code as simple as possible.

As for use of the long time periods… I used the long time intervals because I wanted to watch the button led’s so I could verify that each button was working.

The code is only a test sample to demonstrate the reboot in process. I guess I should have stressed that in my original post.

As a side note: The reason I posted the sample is because of a post found at:
See Kerry H comment…

This is not a fight with anybody. I saw the comment and I thought it was incorrect because I have used the reboot code in one of my applications and it was working. (At least for me).

By the way, is there a difference between soft and hard reboot as far as the FezSpider main code is concerned?