-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patholed.h
More file actions
56 lines (41 loc) · 966 Bytes
/
Copy patholed.h
File metadata and controls
56 lines (41 loc) · 966 Bytes
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* @coding: utf-8
* @Author: vector-wlc
* @Date: 2020-05-26 10:47:55
* @Description: CLASS OLED
*/
#ifndef __OLED_H__
#define __OLED_H__
#include "i2c.h"
#include <stdio.h>
// CLASS Oled
// OLED 使用 I2C 通信
class Oled : public I2c
{
private:
// 写入命令
void writeCmd(uint8_t cmd);
// 写入数据
void writeData(uint8_t data);
// 设置光标
void setPos(uint8_t row, uint8_t col);
public:
Oled(uint8_t _port, uint8_t _scl_pos, uint8_t _sda_pos);
Oled() {}
~Oled() {}
// 清除全屏
void ClearAll();
// 清除一行
void ClearRow(uint8_t row);
// 开启显示
void DisplayOn();
// 关闭显示
void DisplayOff();
// 显示字符
void ShowChar(uint8_t row, uint8_t col, uint8_t ch);
// 显示字符串
void ShowStr(uint8_t row, uint8_t col, const uint8_t *str);
// 显示数字
void ShowNum(uint8_t row, uint8_t col, uint8_t num);
};
#endif