Chapter 4: Building a Device


The Ultimate Flashlight

In this chapter, we will create the ultimate flashlight. With find-in-the-dark flashing behavior and a power-audit mode, this single-button-controlled device will become the ultimate in personal illumination for the twenty-first century.

Figure 4-1 shows how the flashlight will be constructed. The .NET Micro Framework device will have an input from a push-button switch and will provide an output to a lamp. It will also have a connection to an external device so that it can transfer usage information to the external device in response to a trigger message.

image from book
Figure 4-1: The flashlight components.

To make the flashlight work, the program inside it must be able to perform a number of tasks:

  • It will need to provide a signal to turn on the lamp.

  • It will need to read the state of the input button.

  • For some of the later applications, it will need some form of a timer.

  • It will need a way of communicating with an external device.

For the purpose of the exercise, we can use the device emulation features of the .NET Micro Framework, so there will be no need to create a physical device, although there is, of course, nothing stopping us from building one if we wish.




Embedded Programming with the Microsoft .Net Micro Framework
Embedded Programming with the Microsoft .NET Micro Framework
ISBN: 0735623651
EAN: 2147483647
Year: 2007
Pages: 118

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net