Skip to content

Commit

Permalink
添加了中文注释 / Add Chinese annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
TPAXcc authored Jun 25, 2022
1 parent a49a107 commit a6e856e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions HC-SR04/HC-SR04.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//2022.6.25 P.M.1:44
//TPAXcc Form github.com/TPAXcc/Arduino-Ultrasonic
//添加注释

#ifndef HC-SR04_h
#define HC-SR04_h //定义 HC-SR04.h 头文件

//Arduino 版本兼容
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

class SR04 { //声明 SR04 类
public:
SR04(int TP, int EP); //声明 SR04 函数用于初始化对象
float Get(); //声明 Get 函数用于数据获取/处理

private:
//记录所用引脚
int Trig_Pin;
int Echo_Pin;
//记录回传数据
float distance;

};

#endif

0 comments on commit a6e856e

Please sign in to comment.