library for using LM61.

Dependents:   Thermometer TMP36_Anlog_temperature_read

Please connect AnalogIn pin with vout pin of LM61.

Committer:
Match314
Date:
Fri Mar 20 12:33:04 2015 +0000
Revision:
2:7fe5f722fc6b
Parent:
0:ba8b3a1b95ac
Apache License 2.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Match314 2:7fe5f722fc6b 1 /* mbed library for LM61
Match314 2:7fe5f722fc6b 2 *
Match314 2:7fe5f722fc6b 3 * Copyright (C) 2015 Match
Match314 2:7fe5f722fc6b 4 *
Match314 2:7fe5f722fc6b 5 * Licensed under the Apache License, Version 2.0 (the "License");
Match314 2:7fe5f722fc6b 6 * you may not use this file except in compliance with the License.
Match314 2:7fe5f722fc6b 7 * You may obtain a copy of the License at
Match314 2:7fe5f722fc6b 8 *
Match314 2:7fe5f722fc6b 9 * http://www.apache.org/licenses/LICENSE-2.0
Match314 2:7fe5f722fc6b 10 *
Match314 2:7fe5f722fc6b 11 * Unless required by applicable law or agreed to in writing, software
Match314 2:7fe5f722fc6b 12 * distributed under the License is distributed on an "AS IS" BASIS,
Match314 2:7fe5f722fc6b 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Match314 2:7fe5f722fc6b 14 * See the License for the specific language governing permissions and
Match314 2:7fe5f722fc6b 15 * limitations under the License.
Match314 2:7fe5f722fc6b 16 */
Match314 2:7fe5f722fc6b 17
Match314 0:ba8b3a1b95ac 18 #include "LM61.h"
Match314 0:ba8b3a1b95ac 19
Match314 0:ba8b3a1b95ac 20 LM61::LM61(PinName lm61, float vcc) : _lm61(lm61){
Match314 0:ba8b3a1b95ac 21 _vcc = vcc;
Match314 0:ba8b3a1b95ac 22 }
Match314 0:ba8b3a1b95ac 23
Match314 0:ba8b3a1b95ac 24 float LM61::GetTemp() {
Match314 0:ba8b3a1b95ac 25 return (_lm61.read()*_vcc - 0.6f) * 100;
Match314 0:ba8b3a1b95ac 26 }