Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 1 #9

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/library/mPython/mpython.rst
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ Connect WiFi network

- ``ssid`` -WiFi network ID
- ``password`` -WiFi Password
- ``tiemout`` - Link timeout, default 10 seconds
- ``timeout`` - Link timeout, default 10 seconds

.. method:: wifi.disconnectWiFi()

Expand Down
24 changes: 8 additions & 16 deletions docs/en/library/micropython/ntptime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@ This module is used for time synchronization, providing accurate time, Internati
.. admonition:: what is NTP

Network Time Protocol (NTP) is a protocol used to synchronize the time of the computer. It can synchronize the computer to its server or clock source (such as quartz clock, GPS, etc.). It can provide highly precise time calibration.
Note: There's currently no timezone support in MicroPython, and the RTC is set in UTC time.


Method
------


.. method:: settime(timezone=8,server = 'ntp.ntsc.ac.cn')

Synchronize local time

- ``timezone`` - Time zone time difference, the default is East Eight District, compensation 8 hours
- ``server`` - You can specify the time server yourself, server is a string type. The default time server is "ntp.ntsc.ac.cn" .

.. method:: settime()

Example::

Expand All @@ -30,17 +25,14 @@ Example::

mywifi=wifi()
mywifi.connectWiFi('tang','tang123456')

print("Local time before synchronization:%s" %str(time.localtime()))
ntptime.host = 'ntp.ntsc.ac.cn'
ntptime.timeout = 1
ntptime.settime()
print("Local time after synchronization:%s" %str(time.localtime()))
print("Success)

运行结果::

Connecting to network...
WiFi Connection Successful,Network Config:('172.20.10.4', '255.255.255.240', '172.20.10.1', '172.20.10.1')
Local time before synchronization:(2000, 1, 1, 0, 40, 8, 5, 1)
Local time after synchronization:(2018, 12, 27, 12, 10, 7, 3, 361)
MicroPython v1.0.1-dirty on 2018-11-23; mPython with ESP32
Type "help()" for more information.
>>>
Success

6 changes: 3 additions & 3 deletions docs/zh_CN/library/mPython/mpython.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:synopsis: 掌控板板载相关功能函数

:mod:`mpython` --- 掌控板板载相关功能函数
==========================
=========================================

``mpython`` 是基于掌控板封装的专有模块,内含掌控板板载资源相关功能函数。 详细代码实现可查阅 :ref:`mpython.py源码 <mpython_code>` 。

Expand Down Expand Up @@ -63,7 +63,7 @@

.. method:: sound.read()

读取板载麦克风,范围0~4095。
读取板载麦克风,范围0~4095。(测试测量最大值在2600~3000)


加速度计
Expand Down Expand Up @@ -737,7 +737,7 @@ wifi类

- ``ssid`` -WiFi网络名称
- ``password`` -WiFi密码
- ``tiemout`` -链接超时,默认10秒
- ``timeout`` -链接超时,默认10秒

.. method:: wifi.disconnectWiFi()

Expand Down
2 changes: 1 addition & 1 deletion docs/zh_CN/tutorials/basics/sound.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

.. Note::

麦克风使用 ``read()`` 函数来读取数据。返回的值为12bit的ADC采样数据,即最大值为十进制4095。
麦克风使用 ``read()`` 函数来读取数据。返回的值为12bit的ADC采样数据,即最大值为十进制4095。(测试测量最大值在2600~3000)


学会了如何收集周边环境的声音数据,我们可以结合其他功能做更多有趣的场景。
Expand Down