Implementing a Flashlight-Finder Feature Using Threads

Next, we are going to improve our flashlight by adding a finder feature. This is to help users who have problems finding the flashlight in the dark (which is hardly surprising). The addition to the flashlight will cause the lamp to flash for half a second every two minutes. If we need to find the flashlight in the dark, we now just have to wait for a little while until it signals where it is.

Foreground and Background Threads

At the moment, our program contains multiple threads of execution. A thread is created each time an interrupt is required. In addition, we have the original foreground thread that forms the body of the Main method. We can add our flashlight-finder feature by making use ...

Get Embedded Programming with the Microsoft® .NET Micro Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.