* AM2321的取温度间隔得大于2s,否则,i2c会不工作了 * SimpleTimer有个bug,会导致两次快速的读温度,现在读温度函数里加了保护 * Blynk有个bug,会导致无法把数据传到服务器 * 现在可以正常工作了

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers WidgetLCD.h Source File

WidgetLCD.h

Go to the documentation of this file.
00001 /**
00002  * @file       WidgetLCD.h
00003  * @author     Volodymyr Shymanskyy
00004  * @license    This project is released under the MIT License (MIT)
00005  * @copyright  Copyright (c) 2015 Volodymyr Shymanskyy
00006  * @date       Mar 2015
00007  * @brief
00008  */
00009 
00010 #ifndef WidgetLCD_h
00011 #define WidgetLCD_h
00012 
00013 #include <Blynk/BlynkApi.h>
00014 
00015 class WidgetLCD
00016 {
00017 public:
00018     WidgetLCD(uint8_t pin) : mPin(pin) {}
00019     void setVPin(int vPin) { mPin = vPin; }
00020 
00021     void clear() {
00022         Blynk.virtualWrite(mPin, "clr");
00023     }
00024 
00025     template<typename T>
00026     void print(int x, int y, const T& str) {
00027         char mem[64] = "";
00028         BlynkParam cmd(mem, 0, sizeof(mem));
00029         cmd.add("p");
00030         cmd.add(x);
00031         cmd.add(y);
00032         cmd.add(str);
00033         Blynk.virtualWrite(mPin, cmd);
00034     }
00035 
00036 private:
00037     uint8_t mPin;
00038 };
00039 
00040 #endif
00041