The first user control allowing users to enter any text data into your application, using buttons. Features TextChanged event, selection, insert/overtype mode, input length and numbers-only limit, or characters masking for password entering. Although it is also possible to align the text to the center and to the right, in these cases text longer than the control is not rendered very well. Neither multiline text nor wrapping is supported. The project contains fully commented source code of the text box and some helper classes, and demo application for standard Microsoft's emulator. You can check the ButtonTextBox class itself here.
Updates: works in both 3.0 and 2.x, demo project updated to 3.0.
This struct is for representing day time, ranging 00:00 - 24:00 with milisecond precision. Methods for simple operations like AddHour() make the value easily controllable by small number of buttons. XML comments so far in Czech.
Most of boards currently available do not have back-uped time source, which results in having the system time (Utility.GetMachineTime()) reseted to 1.1.2004 on every restart. There are two ways how to get the current time nowadays - either from GPS or using some signal available at radio frequency (complete list on wikipedia). There are serious problems with signals inhouse, the more without any antenna, so you might find handy to sync with some radio signal.
One of such signals is the DCF-77, transmitted from the location near Frankfurt (cca 2500 km coverage). The Conrad company sells a small board (part no. 641138) with demodulator, which can be connected directly (the inverted DCF output) to the processor's pull-uped input. This class is able to decode the DCF signal, as well as check the parity. As a bonus, you can easily find whether the DCF board is working by supplying output pin for LED as well.
Updates: works in 3.0, implemented pull-up resistors option.
(you will need IEEE.Single.cs as well) Although we have two Math classes, none of them contains the logarithm. After several hard days I've successfully implemented an algorithm described by Keith Larson in the Fast Logarithms on a Floating-Point Device application note. It uses binary format of the floating-point number and processor's floating-point ALU to speed-up the computation. The class contains Log2, Log, Log10 methods for computing logarithms of base 2, e (natural) and 10 respectively, and then a FastLog2 method for very fast approximation of the logarithm value (in constant time). Unfortunately we can't use unsafe code, so I had to use a little serialization trick which I hope is not too slow. The logarithm is computed in single-precision (i.e. float type), which is native to the processors. You can further adjust the precision by undefining the HIGH_PRECISION symbol, which reduces the computation time about one fourth and drops precision from full 23 bits to 21 bits. Let me know if anybody needs to compute logarithm of the double type, but keep in mind that this type is emulated by the runtime and the performance will thus likely suffer.
A simple matrix keyboard driver and input manager allowing you to use matrix keyboards in .NET Micro Framework. Unfortunately, the classes are not commented yet, but there is an article describing their fundamentals.
Updates: works in 3.0.
The Noritake-Itron company produces really cool, VFD displays (Vacuum Fluorescent Display). They have various resolutions, features and communication interfaces, you can even connect multiple of them to one bus. The best thing is that the commands are common for all of them. And I've wrapped the most of them in this class for you - remain user settings, macro and GPIO support, which requires the more expensive display series anyway. If anybody would be interested in implementation, no problem to complete it. Includes XML comments according to datasheets.
As you have probably already noted, .NET Micro Framework comes with only minimal amount of Panels. I have a suspicion this is due to lack of real dependency and attached properties.
With a help of Reflector I'm putting together the basic panels missing in the .NET Micro Framework. Meanwhile, DockPanel and WrapPanel are available, we can try others as well if there will be demand from you. Important note to using DockPanel: The HorizontalAlignment and VericalAlignment being set to Stretch aren't always fulfilled (I think this is quite a bug). So if you want the last control to fill the remaining panel space, you would likely have to derive from its class and override the ArrangeOverride method.
Fully commented class, which is trying to fill some deficiencies in the SerialPort in framework version 2.5. Features:
If you just need to read and write lines, I suggest to use the Pavel's class. Hopefully similar classes will not be needed anymore in the upcoming version of framework.
Even on the simplest web server it is necessary to decode URLs during request processing, because browsers do encode addresses and form values. There is a System.Web.HttpUtility class in the .NET Framework, which we unfortunately don't have. So I had to wrote a lighter version of the UrlDecode method. It works the same as the big one, but supports only UTF8 encoding and for simplicity the conversion runs without the help of an UrlDecoder.
Simple class demonstrating how you can animate a background-less control's background using separate images from resources. You pass the interval between frames to the constructor as well as first and last frames IDs. The resource bitmaps are required to have sequential IDs, see this article on how to do that. And don't forget to call Play()! If you however have all frames in one bitmap, you might find Pavel's animation example more useful.
There is only one component, which has to be implemented differently than with the Windows Forms technology - the LCD display. A sample WPF emulator with display support (only), fully commented class and some ideas how could one use the data binding feature in emulators. This example does not follow any sophisticated model, just the easiest working way. The emulator does not register itself, it is more for reference - you have to set a command line arguments to load a .NET Micro Framework project in order to run it.
If you are developing an application for display-less device, but the development board has the display attached, or if you need to test the device without having Visual Studio attached, you might find this console window (with clocks) helpful. Simply add a reference and use Console.WriteLine(string). The file contains source code and an example project. Warning: it is not yet possible to use this "console" in other windows application.
An example of how to plot signals on the display. The user control allows redrawing the signal periodicaly, scroll and zoom indepently in both axes, set the axes coordinates, grid intervals and display some description. You can use anything what derives from the SignalSource abstract class and implements the GetValue(float x) method as a signal source. Each signal can have its own name, color/pen, visibility and image and domain ranges. I've implemented four types of such signals for you:
There is a test project in the file, from which the screenshot was taken. These are the button assignments on Microsoft's standard emulator:
Updates: demo project updated to 3.0.
Allows you to join several pins into one "parallel" port, and thus write out numbers in bit representation (by default requires PortStore class below). Unfortunately, the pin toggle speed in managed code is so slow, that even with serial interface you could get better data throughput. In addition to standard implementations (eg. Pavel's here), this has one dedicated input signal to interrupt data writing (busySignal) as well as special output to indicate that all pins have set the desired value (dataReady). If you need join pins for reading, see Pavel's MultiInputPort class.
Updates: works in 3.0 version, added PortStore-less equivalent code in comments.
If you can't get used to the declaring and disposing ports during application execution, you can use a principle sketched in this static class. The output and input ports are usually fixed in the real applications. This class has a GetInput(Cpu.Pin), GetOutput(Cpu.Pin) and GetTristate(Cpu.Pin) methods, which either returns an InputPort, OutputPort resp. TristatePort instance if already instantiated, or creates a new one. Interrupt port can be easily added in a similar way, but that's not usually needed. This class can be used to comfortably manipulate ports from multiple threads simultaneously.