Papouch TMU USB thermometer
communication library and sample

Introduction

This C# application contains the PapouchSensorTMU class, which may be used in your applications to read data from the "TMU" digital thermometer.

Microsoft .NET Framework 2.0 is required for running this application. Microsoft Visual Studio 2005 or Microsoft Visual C# Express is required to open the sample project and to compile the application.

Usage of the PapouchSensorTMU class

Constructor of this class takes single argument, which is name of virtual serial port to which is the TMU sensor connected, ie. COM4. Then call the ReadSample method to get current temperature in degrees of Celsius. The following code demonstrates the usage:

PapouchSensorTMU sensor = new PapouchSensorTMU("COM4");

try {

    float t = sensor.ReadSample();

    MessageBox.Show(string.Format("Temperature is {0:N1} °C", t), "Result", MessageBoxButtons.OK, MessageBoxIcon.Information);

}

catch (Exception ex) {

    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);

}

Contacts

Manufacturer of the TMU sensor is Papouch, s. r. o.

Author of this sample is Michal Altair Valasek from Altairis, s. r. o.

Licensing

Copyright © Michal Altair Valasek - Altairis, 2006
This program is free software licensed under terms of the BSD license.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.