forked from blynkkk/blynk-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWidgetLCD.h
38 lines (31 loc) · 779 Bytes
/
WidgetLCD.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* @file WidgetLCD.h
* @author Volodymyr Shymanskyy
* @license This project is released under the MIT License (MIT)
* @copyright Copyright (c) 2015 Volodymyr Shymanskyy
* @date Mar 2015
* @brief
*/
#ifndef WidgetLCD_h
#define WidgetLCD_h
#include <Blynk/BlynkWidgetBase.h>
class WidgetLCD
: public BlynkWidgetBase
{
public:
WidgetLCD(uint8_t vPin) : BlynkWidgetBase(vPin) {}
void clear() {
Blynk.virtualWrite(mPin, "clr");
}
template<typename T>
void print(int x, int y, const T& str) {
char mem[BLYNK_MAX_SENDBYTES];
BlynkParam cmd(mem, 0, sizeof(mem));
cmd.add("p");
cmd.add(x);
cmd.add(y);
cmd.add(str);
Blynk.virtualWrite(mPin, cmd);
}
};
#endif