library for using LM61.

Dependents:   Thermometer TMP36_Anlog_temperature_read

Please connect AnalogIn pin with vout pin of LM61.

LM61.cpp

Committer:
Match314
Date:
2015-03-20
Revision:
2:7fe5f722fc6b
Parent:
0:ba8b3a1b95ac

File content as of revision 2:7fe5f722fc6b:

/* mbed library for LM61
 * 
 * Copyright (C) 2015 Match
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "LM61.h"

LM61::LM61(PinName lm61, float vcc) : _lm61(lm61){
    _vcc = vcc;
}

float LM61::GetTemp() {
    return (_lm61.read()*_vcc - 0.6f) * 100;
}