O'Reilly logo

Embedded Programming with the Microsoft® .NET Micro Framework by Rob Miles, Donald Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required