library for using LM61.
Dependents: Thermometer TMP36_Anlog_temperature_read
LM61.h
00001 /* mbed library for LM61 00002 * 00003 * Copyright (C) 2015 Match 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 #ifndef LM61_H_2014_12_31 00019 #define LM61_H_2014_12_31 00020 00021 #include "mbed.h" 00022 00023 /** Get temperature from LM61 class 00024 * 00025 * Example: 00026 * @code 00027 * #include "LM61.h" 00028 * #include "mbed.h" 00029 * 00030 * LM61 lm61(dp4, 3.0f); 00031 * Serial pc(USBTX, USBRX); 00032 * 00033 * int main() { 00034 * float temp; 00035 * 00036 * while(1) { 00037 * temp = lm61.GetTemp(); 00038 * pc.printf("Temperature : %5.1fdeg\n", temp); 00039 * wait(1); 00040 * } 00041 * } 00042 * @endcode 00043 */ 00044 class LM61 { 00045 public: 00046 00047 /** A constructor of LM61 class 00048 * @param lm61 pin connected to vout of LM61 00049 * @param vcc Vcc voltage 00050 */ 00051 LM61(PinName lm61, float vcc=3.3f); 00052 00053 /** Get temperature from LM61 00054 * @return temperature from LM61 in degree 00055 */ 00056 float GetTemp(); 00057 00058 private: 00059 AnalogIn _lm61; 00060 float _vcc; 00061 }; 00062 00063 00064 #endif // LM61_H_2014_12_31
Generated on Fri Jul 15 2022 02:00:59 by 1.7.2