Sean Blakemore's Blog

Like trying to fit a square peg in a round hole

20. February 2012 16:43
by Sean
0 Comments

DIY PCB Drill Press for $15 (sort of)

20. February 2012 16:43 by Sean | 0 Comments

I’ve recently been working on producing my own PCBs at home and ran into the problem of how to reliably and accurately drill the holes I needed.

I had a quick search to see how other people were attacking the problem and managed to find a design for a home made drill press on Instructables which was genius in it’s simplicity. Four hinges and some lengths of timber combine to make an almost perfect plunge action with great accuracy. Here is my take on the idea with photos of the mechanism and a quick video showing it in action.

More...

18. February 2012 13:23
by Sean
0 Comments

Power Management in C# – Stop the system or display from sleeping

18. February 2012 13:23 by Sean | 0 Comments

In a desktop application I’m working on there are a number of long running batch processes that can be run by the user. This caused problems when the user kicked off a batch process and then walked away from the computer, returning a few hours later to find that the system had gone to sleep and the batch had failed!

SetThreadExecutionState

A little searching led me to the unmanaged SetThreadExecutionState function which can be used to tell Windows that the calling thread is doing something important which requires the system to be awake. The function can be used in two ways, it can be called repeatedly to reset the system’s idle timer or it can be used in “continuous” mode where the system should not enter sleep mode until told otherwise. Check the MSDN link above for full details.

More...