Skip to content

Commit f173ceb

Browse files
Document update
1 parent 40c5ac9 commit f173ceb

File tree

6 files changed

+370
-48
lines changed

6 files changed

+370
-48
lines changed

README.md

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ English | [简体中文](#简体中文)
44

55
**This library must work with [Heltec ESP32 develop framework](https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series)! A detail document about how to install Heltec ESP32 development framework and this library available here:**
66

7-
**[http://docs.heltec.cn/#/en/user_manual/how_to_install_esp32_Arduino](http://docs.heltec.cn/#/en/user_manual/how_to_install_esp32_Arduino)**
7+
**[https://heltec-automation-docs.readthedocs.io/en/latest/esp32/quick_start.html](https://heltec-automation-docs.readthedocs.io/en/latest/esp32/quick_start.html)**
88

99
## CONTENT
1010

@@ -18,12 +18,7 @@ English | [简体中文](#简体中文)
1818

1919
3. [API Reference](#api-reference)
2020

21-
4. [Hardware Reference](#hardware-reference)
22-
23-
- [PinoutDiagram](#pinoutdiagram)
24-
25-
- [Schematic Diagram](#schematic-diagram)
26-
21+
4. [Relevant Resources](#relevant-resources)
2722

2823
***
2924

@@ -34,14 +29,17 @@ English | [简体中文](#简体中文)
3429
### Use Arduino Library Manager
3530
Open Arduino IDE, then Select `Sketch`->`Include Library`->`Manage Libraries...`
3631
Search `Heltec ESP32` and install it.
37-
<img src="http://docs.heltec.cn/img/how_to_install_esp32_Arduino/06.png">
38-
<img src="http://docs.heltec.cn/img/how_to_install_esp32_Arduino/07.jpg">
32+
![image](img/01.png)
33+
34+
&nbsp;
35+
36+
![image](img/02.png)
3937

4038
### Use Git
4139

42-
*Firstly, make sure git and the Arduino IDE have been installed first. If not, please refer [How to install Git and Arduino](http://docs.heltec.cn/#/en/user_manual/how_to_install_git_and_arduino). When Arduino is installed correctly, you will find a folder in "Username/Documents/Arduino/Library". **this library must in this path!***
40+
*Firstly, make sure git and the Arduino IDE have been installed first. If not, please refer [How to install Git and Arduino](https://heltec-automation-docs.readthedocs.io/en/latest/general/how_to_install_git_and_arduino.html). When Arduino is installed correctly, you will find a folder in "Username/Documents/Arduino/Library". **this library must in this path!***
4341

44-
Open "Git bash" in path "Username/Documents/Arduino/Library", and input:
42+
Open "Git bash" in path `Username/Documents/Arduino/Library`, and input:
4543

4644
git clone https://github.com/HelTecAutomation/Heltec_ESP32.git
4745

@@ -52,29 +50,32 @@ You will see such a new folder in your library path, install done.
5250

5351
## How to use this library
5452

55-
**`This library requires the [Heltec ESP32 develop framework](https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series)!`**
53+
**This library requires the [Heltec ESP32 develop framework](https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series)!**
5654

5755
A detailed step by step instructions to execute some examples available here:
5856

59-
[http://docs.heltec.cn/#/en/user_manual/how_to_install_esp32_Arduino?id=_1-execute-a-example-likes-factorytestino](http://docs.heltec.cn/#/en/user_manual/how_to_install_esp32_Arduino?id=_1-execute-a-example-likes-factorytestino)
57+
[https://heltec-automation-docs.readthedocs.io/en/latest/esp32/quick_start.html#example](https://heltec-automation-docs.readthedocs.io/en/latest/esp32/quick_start.html#example)
6058

6159
## API Reference
62-
[OLED API](https://github.com/HelTecAutomation/Heltec_ESP32/blob/master/src/oled/OLEDDisplay.h)
60+
[OLED API](src/oled/API.md)
6361

6462
[LoRa API](src/lora/API.md)
6563

66-
## Hardware Reference
64+
## Relevant Resources
6765

68-
### Pinout Diagram
69-
[https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/tree/master/PinoutDiagram](https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/tree/master/PinoutDiagram)
70-
### Schematic Diagram
71-
[https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/tree/master/SchematicDiagram](https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/tree/master/SchematicDiagram)
66+
- [WiFi Kit 32](https://resource.heltec.cn/download/WiFi_Kit_32)
67+
- [WiFi LoRa 32](https://resource.heltec.cn/download/WiFi_LoRa_32)
68+
- [Wireless Stick](https://resource.heltec.cn/download/Wireless_Stick)
69+
- [Wireless Stick Lite](https://resource.heltec.cn/download/Wireless_Stick_Lite)
70+
- [Wireless Shell](https://resource.heltec.cn/download/Wireless_Shell)
71+
72+
If there is a "Limited" folder in the resources page, it means the product have limited resources that not public by default, refer to this document to download: [Get Limited Technical Resources](https://heltec-automation-docs.readthedocs.io/en/latest/general/view_limited_technical_data.html).
7273

7374

7475
#### Note:
75-
* ESP series chips are faster to download, please make sure to use the high-quality Micro USB cable, it will be easier to download with.
76+
Please make sure use a high-quality Micro USB cable, it will reduce many problems.
7677

77-
[Summary of common problems](http://www.heltec.cn/summary-of-common-problems-in-wifi-kit-series-continuous-update/?lang=en)
78+
[Summary of common problems](https://heltec-automation-docs.readthedocs.io/en/latest/esp32/frequently_asked_questions.html)
7879

7980
&nbsp;
8081
***
@@ -85,7 +86,7 @@ A detailed step by step instructions to execute some examples available here:
8586

8687
**这个Arduino库必须配合[Heltec ESP32编译环境](https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series)一起使用!完整的“编译环境 + 库”的的教程可以参考这里:**
8788

88-
**[http://docs.heltec.cn/#/en/user_manual/how_to_install_esp32_Arduino](http://docs.heltec.cn/#/en/user_manual/how_to_install_esp32_Arduino)**
89+
**[https://heltec-automation-docs.readthedocs.io/en/latest/esp32/quick_start.html](https://heltec-automation-docs.readthedocs.io/en/latest/esp32/quick_start.html)**
8990

9091
***
9192

@@ -101,12 +102,7 @@ A detailed step by step instructions to execute some examples available here:
101102

102103
3. [API参考](#API参考)
103104

104-
4. [硬件设计参考](#硬件设计参考)
105-
106-
- [引脚图](#引脚图)
107-
108-
- [原理图](#原理图)
109-
105+
4. [相关资源](#相关资源)
110106

111107
***
112108

@@ -117,12 +113,17 @@ A detailed step by step instructions to execute some examples available here:
117113
### 通过Arduino库管理器安装
118114
打开Arduino IDE, 选择`项目`->`加载库`->`管理库...`,打开“库管理器”
119115
搜索`Heltec ESP32`并安装.
120-
<img src="http://docs.heltec.cn/img/how_to_install_esp32_Arduino/06.png">
121-
<img src="http://docs.heltec.cn/img/how_to_install_esp32_Arduino/07.jpg">
116+
![image](img/01.png)
117+
118+
&nbsp;
119+
120+
![image](img/02.png)
121+
122+
122123

123124
### 通过Git进行安装
124125

125-
*首先,请确保`Git``Arduino IDE`都已经正确安装。如果没有,请参考这里的安装方法[How to install Git and Arduino](http://docs.heltec.cn/#/en/user_manual/how_to_install_git_and_arduino)。 *
126+
*首先,请确保`Git``Arduino IDE`都已经正确安装。如果没有,请参考这里的安装方法[怎样安装Git和Arduino IDE](https://heltec-automation.readthedocs.io/zh_CN/latest/general/how_to_install_git_and_arduino.html)。 *
126127

127128
**强调一下:这个库的路径必须位于操作系统的“文档/Arduino/libraries”文件夹内!!!文档文件夹是操作系统自带的,必须!必须!必须!**
128129

@@ -139,20 +140,21 @@ A detailed step by step instructions to execute some examples available here:
139140

140141
如何运行一个例程?详细的使用指南::
141142

142-
[http://docs.heltec.cn/#/en/user_manual/how_to_install_esp32_Arduino?id=_1-execute-a-example-likes-factorytestino](http://docs.heltec.cn/#/en/user_manual/how_to_install_esp32_Arduino?id=_1-execute-a-example-likes-factorytestino)
143+
[https://heltec-automation.readthedocs.io/zh_CN/latest/esp32/quick_start.html#id1](https://heltec-automation.readthedocs.io/zh_CN/latest/esp32/quick_start.html#id1)
143144

144145
## API参考
145-
[OLED API](https://github.com/HelTecAutomation/Heltec_ESP32/blob/master/src/oled/OLEDDisplay.h)
146+
[OLED API](src/oled/API.md)
146147

147148
[LoRa API](src/lora/API.md)
148149

149-
## 硬件设计参考
150-
151-
### 引脚图
152-
[https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/tree/master/PinoutDiagram](https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/tree/master/PinoutDiagram)
153-
### 原理图
154-
[https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/tree/master/SchematicDiagram](https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/tree/master/SchematicDiagram)
150+
## 相关资源
155151

152+
- [WiFi Kit 32](https://resource.heltec.cn/download/WiFi_Kit_32)
153+
- [WiFi LoRa 32](https://resource.heltec.cn/download/WiFi_LoRa_32)
154+
- [Wireless Stick](https://resource.heltec.cn/download/Wireless_Stick)
155+
- [Wireless Stick Lite](https://resource.heltec.cn/download/Wireless_Stick_Lite)
156+
- [Wireless Shell](https://resource.heltec.cn/download/Wireless_Shell)
156157

158+
如果在资源下载页中看到了`Limited`文件夹,表面这个产品有非公开的技术资料。[获取受限资源的方法](https://heltec-automation.readthedocs.io/zh_CN/latest/general/view_limited_technical_data.html)
157159

158160

examples/ESP32/ADC_Read_Voltage/Battery_power/Battery_power.ino

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#define Fbattery 3700 //The default battery is 3700mv when the battery is fully charged.
2828

29-
float XS = 0.00225; //The returned reading is multiplied by this XS to get the battery voltage.
29+
float XS = 0.0025; //The returned reading is multiplied by this XS to get the battery voltage.
3030
uint16_t MUL = 1000;
3131
uint16_t MMUL = 100;
3232

@@ -42,10 +42,26 @@ void setup()
4242
delay(1000);
4343
Heltec.display->clear();
4444

45-
adcAttachPin(13);
46-
analogSetClockDiv(255); // 1338mS
45+
//analogSetClockDiv(255); // 1338mS
46+
analogSetCycles(8); // Set number of cycles per sample, default is 8 and provides an optimal result, range is 1 - 255
47+
analogSetSamples(1); // Set number of samples in the range, default is 1, it has an effect on sensitivity has been multiplied
48+
analogSetClockDiv(1); // Set the divider for the ADC clock, default is 1, range is 1 - 255
49+
analogSetAttenuation(ADC_11db); // Sets the input attenuation for ALL ADC inputs, default is ADC_11db, range is ADC_0db, ADC_2_5db, ADC_6db, ADC_11db
50+
analogSetPinAttenuation(36,ADC_11db); // Sets the input attenuation, default is ADC_11db, range is ADC_0db, ADC_2_5db, ADC_6db, ADC_11db
51+
analogSetPinAttenuation(37,ADC_11db);
52+
// ADC_0db provides no attenuation so IN/OUT = 1 / 1 an input of 3 volts remains at 3 volts before ADC measurement
53+
// ADC_2_5db provides an attenuation so that IN/OUT = 1 / 1.34 an input of 3 volts is reduced to 2.238 volts before ADC measurement
54+
// ADC_6db provides an attenuation so that IN/OUT = 1 / 2 an input of 3 volts is reduced to 1.500 volts before ADC measurement
55+
// ADC_11db provides an attenuation so that IN/OUT = 1 / 3.6 an input of 3 volts is reduced to 0.833 volts before ADC measurement
56+
// adcAttachPin(VP); // Attach a pin to ADC (also clears any other analog mode that could be on), returns TRUE/FALSE result
57+
// adcStart(VP); // Starts an ADC conversion on attached pin's bus
58+
// adcBusy(VP); // Check if conversion on the pin's ADC bus is currently running, returns TRUE/FALSE result
59+
// adcEnd(VP);
60+
61+
adcAttachPin(36);
62+
adcAttachPin(37);
4763

48-
Serial.begin(115200);
64+
Serial.begin(115200);
4965
}
5066

5167
void loop()
@@ -55,16 +71,37 @@ void loop()
5571
//Wireless Stick -- hardare versrion ≥ 2.3
5672
//Wireless Stick Lite -- hardare versrion ≥ 2.3
5773
//Battery voltage read pin changed from GPIO13 to GPI37
58-
uint16_t c = analogRead(37)*XS*MUL;
74+
adcStart(37);
75+
while(adcBusy(37));
76+
Serial.printf("Battery power in GPIO 37: ");
5977
Serial.println(analogRead(37));
78+
uint16_t c1 = analogRead(37)*XS*MUL;
79+
adcEnd(37);
80+
81+
delay(100);
82+
83+
adcStart(36);
84+
while(adcBusy(36));
85+
Serial.printf("voltage input on GPIO 36: ");
86+
Serial.println(analogRead(36));
87+
uint16_t c2 = analogRead(36)*0.769 + 150;
88+
adcEnd(36);
89+
Serial.println("-------------");
6090
// uint16_t c = analogRead(13)*XS*MUL;
6191
// Serial.println(analogRead(13));
92+
Heltec.display->drawString(0, 0, "Vbat = ");
93+
Heltec.display->drawString(33, 0, (String)c1);
94+
Heltec.display->drawString(60, 0, "(mV)");
6295

63-
Heltec.display->drawString(0, 0, "Remaining battery still has:");
64-
Heltec.display->drawString(0, 10, "VBAT:");
65-
Heltec.display->drawString(35, 10, (String)c);
96+
Heltec.display->drawString(0, 10, "Vin = ");
97+
Heltec.display->drawString(33, 10, (String)c2);
6698
Heltec.display->drawString(60, 10, "(mV)");
99+
100+
// Heltec.display->drawString(0, 0, "Remaining battery still has:");
101+
// Heltec.display->drawString(0, 10, "VBAT:");
102+
// Heltec.display->drawString(35, 10, (String)c);
103+
// Heltec.display->drawString(60, 10, "(mV)");
67104
Heltec.display->display();
68-
delay(2000);
105+
delay(5000);
69106
Heltec.display->clear();
70107
}

examples/OLED/SSD1306SimpleDemo/images.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ const unsigned char WiFi_Logo_bits[] PROGMEM = {
3030
//Added by Sloeber
3131
#pragma once
3232

33+
34+
//Added by Sloeber
35+
#pragma once

img/01.png

758 KB
Loading

img/02.png

119 KB
Loading

0 commit comments

Comments
 (0)