Skip to content
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 micropython/bluetooth/aioble/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async with aioble.scan(duration_ms=5000, interval_us=30000, window_us=30000, act
# Either from scan result
device = result.device
# Or with known address
device = aioble.Device(aioble.PUBLIC, "aa:bb:cc:dd:ee:ff")
device = aioble.Device(aioble.ADDR_PUBLIC, "aa:bb:cc:dd:ee:ff")

try:
connection = await device.connect(timeout_ms=2000)
Expand Down
4 changes: 2 additions & 2 deletions micropython/bluetooth/aioble/examples/temp_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
_ADV_APPEARANCE_GENERIC_THERMOMETER = const(768)

# How frequently to send advertising beacons.
_ADV_INTERVAL_MS = 250_000
_ADV_INTERVAL_US = 250_000


# Register GATT server.
Expand Down Expand Up @@ -50,7 +50,7 @@ async def sensor_task():
async def peripheral_task():
while True:
async with await aioble.advertise(
_ADV_INTERVAL_MS,
_ADV_INTERVAL_US,
name="mpy-temp",
services=[_ENV_SENSE_UUID],
appearance=_ADV_APPEARANCE_GENERIC_THERMOMETER,
Expand Down
36 changes: 18 additions & 18 deletions micropython/drivers/imu/bmi270/bmi270.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Basic example usage:
Basic example usage::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not against this indenting change, but doe we need to make it RST compatible with the double colon?

I'm curious why you made the change / how you found these problems? It's not really supposed to be RST format.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted the RST :: and `` in this and other files.

import time
from bmi270 import BMI270
from machine import Pin, SPI, I2C
# Init in I2C mode.
imu = BMI270(I2C(1, scl=Pin(15), sda=Pin(14)))
# Or init in SPI mode.
# TODO: Not supported yet.
# imu = BMI270(SPI(5), cs=Pin(10))
while (True):
print('Accelerometer: x:{:>6.3f} y:{:>6.3f} z:{:>6.3f}'.format(*imu.accel()))
print('Gyroscope: x:{:>6.3f} y:{:>6.3f} z:{:>6.3f}'.format(*imu.gyro()))
print('Magnetometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.magnet()))
print("")
time.sleep_ms(100)
import time
from bmi270 import BMI270
from machine import Pin, SPI, I2C
# Init in I2C mode.
imu = BMI270(I2C(1, scl=Pin(15), sda=Pin(14)))
# Or init in SPI mode.
# TODO: Not supported yet.
# imu = BMI270(SPI(5), cs=Pin(10))
while (True):
print('Accelerometer: x:{:>6.3f} y:{:>6.3f} z:{:>6.3f}'.format(*imu.accel()))
print('Gyroscope: x:{:>6.3f} y:{:>6.3f} z:{:>6.3f}'.format(*imu.gyro()))
print('Magnetometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.magnet()))
print("")
time.sleep_ms(100)
"""

import array
Expand Down
2 changes: 1 addition & 1 deletion micropython/drivers/imu/bmi270/manifest.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
metadata(description="BOSCH BMI270 IMU driver.", version="1.0.0")
metadata(description="BOSCH BMI270 IMU driver.", version="1.0.1")
module("bmi270.py", opt=3)
24 changes: 12 additions & 12 deletions micropython/drivers/imu/bmm150/bmm150.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Basic example usage:
Basic example usage::

import time
from bmm150 import BMM150
from machine import Pin, SPI, I2C
import time
from bmm150 import BMM150
from machine import Pin, SPI, I2C

# Init in I2C mode.
imu = BMM150(I2C(1, scl=Pin(15), sda=Pin(14)))
# Init in I2C mode.
imu = BMM150(I2C(1, scl=Pin(15), sda=Pin(14)))

# Or init in SPI mode.
# TODO: Not supported yet.
# imu = BMM150(SPI(5), cs=Pin(10))
# Or init in SPI mode.
# TODO: Not supported yet.
# imu = BMM150(SPI(5), cs=Pin(10))

while (True):
print('magnetometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.magnet()))
time.sleep_ms(100)
while (True):
print('magnetometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.magnet()))
time.sleep_ms(100)
"""

import array
Expand Down
2 changes: 1 addition & 1 deletion micropython/drivers/imu/bmm150/manifest.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
metadata(description="BOSCH BMM150 magnetometer driver.", version="1.0.0")
metadata(description="BOSCH BMM150 magnetometer driver.", version="1.0.1")
module("bmm150.py", opt=3)
26 changes: 13 additions & 13 deletions micropython/drivers/imu/lsm6dsox/lsm6dsox.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Basic example usage:
Basic example usage::

import time
from lsm6dsox import LSM6DSOX
import time
from lsm6dsox import LSM6DSOX

from machine import Pin, SPI, I2C
# Init in I2C mode.
lsm = LSM6DSOX(I2C(0, scl=Pin(13), sda=Pin(12)))
from machine import Pin, SPI, I2C
# Init in I2C mode.
lsm = LSM6DSOX(I2C(0, scl=Pin(13), sda=Pin(12)))

# Or init in SPI mode.
#lsm = LSM6DSOX(SPI(5), cs=Pin(10))
# Or init in SPI mode.
#lsm = LSM6DSOX(SPI(5), cs=Pin(10))

while (True):
print('Accelerometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*lsm.accel()))
print('Gyroscope: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*lsm.gyro()))
print("")
time.sleep_ms(100)
while (True):
print('Accelerometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*lsm.accel()))
print('Gyroscope: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*lsm.gyro()))
print("")
time.sleep_ms(100)
"""

import array
Expand Down
2 changes: 1 addition & 1 deletion micropython/drivers/imu/lsm6dsox/manifest.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
metadata(description="ST LSM6DSOX imu driver.", version="1.0.1")
metadata(description="ST LSM6DSOX imu driver.", version="1.0.2")
module("lsm6dsox.py", opt=3)
24 changes: 12 additions & 12 deletions micropython/drivers/imu/lsm9ds1/lsm9ds1.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@
The sensor contains an accelerometer / gyroscope / magnetometer
Uses the internal FIFO to store up to 16 gyro/accel data, use the iter_accel_gyro generator to access it.

Example usage:
Example usage::

import time
from lsm9ds1 import LSM9DS1
from machine import Pin, I2C
import time
from lsm9ds1 import LSM9DS1
from machine import Pin, I2C

imu = LSM9DS1(I2C(1, scl=Pin(15), sda=Pin(14)))
imu = LSM9DS1(I2C(1, scl=Pin(15), sda=Pin(14)))

while (True):
#for g,a in imu.iter_accel_gyro(): print(g,a) # using fifo
print('Accelerometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.accel()))
print('Magnetometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.magnet()))
print('Gyroscope: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.gyro()))
print("")
time.sleep_ms(100)
while (True):
#for g,a in imu.iter_accel_gyro(): print(g,a) # using fifo
print('Accelerometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.accel()))
print('Magnetometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.magnet()))
print('Gyroscope: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}'.format(*imu.gyro()))
print("")
time.sleep_ms(100)
"""

import array
Expand Down
2 changes: 1 addition & 1 deletion micropython/drivers/imu/lsm9ds1/manifest.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
metadata(description="Driver for ST LSM9DS1 IMU.", version="1.0.0")
metadata(description="Driver for ST LSM9DS1 IMU.", version="1.0.1")
module("lsm9ds1.py", opt=3)
6 changes: 4 additions & 2 deletions micropython/drivers/sensor/ds18x20/ds18x20.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# DS18x20 temperature sensor driver for MicroPython.
# MIT license; Copyright (c) 2016 Damien P. George
"""DS18x20 temperature sensor driver for MicroPython.

MIT license; Copyright (c) 2016 Damien P. George
"""

from micropython import const

Expand Down
2 changes: 1 addition & 1 deletion micropython/drivers/sensor/ds18x20/manifest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
metadata(description="DS18x20 temperature sensor driver.", version="0.1.0")
metadata(description="DS18x20 temperature sensor driver.", version="0.1.1")

require("onewire")
module("ds18x20.py", opt=3)
22 changes: 12 additions & 10 deletions micropython/drivers/sensor/hs3003/hs3003.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,23 @@
THE SOFTWARE.

HS3003 driver for MicroPython.
------------------------------

Example usage:

import time
from hs3003 import HS3003
from machine import Pin, I2C
import time
from hs3003 import HS3003
from machine import Pin, I2C

bus = I2C(1, scl=Pin(15), sda=Pin(14))
hts = HS3003(bus)
bus = I2C(1, scl=Pin(15), sda=Pin(14))
hts = HS3003(bus)

while True:
rH = hts.humidity()
temp = hts.temperature()
print ("rH: %.2f%% T: %.2fC" %(rH, temp))
time.sleep_ms(100)

while True:
rH = hts.humidity()
temp = hts.temperature()
print ("rH: %.2f%% T: %.2fC" %(rH, temp))
time.sleep_ms(100)
"""

import struct
Expand Down
2 changes: 1 addition & 1 deletion micropython/drivers/sensor/hs3003/manifest.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
metadata(description="Renesas HS3003 Humidity and Temperature sensor driver.", version="1.0.0")
metadata(description="Renesas HS3003 Humidity and Temperature sensor driver.", version="1.0.1")
module("hs3003.py", opt=3)
22 changes: 12 additions & 10 deletions micropython/drivers/sensor/hts221/hts221.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,24 @@
THE SOFTWARE.

HTS221 driver driver for MicroPython.
-------------------------------------

Original source: https://github.com/ControlEverythingCommunity/HTS221/blob/master/Python/HTS221.py

Example usage:

import time
import hts221
from machine import Pin, I2C
import time
import hts221
from machine import Pin, I2C

bus = I2C(1, scl=Pin(15), sda=Pin(14))
hts = hts221.HTS221(bus)
bus = I2C(1, scl=Pin(15), sda=Pin(14))
hts = hts221.HTS221(bus)

while (True):
rH = hts.humidity()
temp = hts.temperature()
print ("rH: %.2f%% T: %.2fC" %(rH, temp))
time.sleep_ms(100)
while (True):
rH = hts.humidity()
temp = hts.temperature()
print ("rH: %.2f%% T: %.2fC" %(rH, temp))
time.sleep_ms(100)
"""

import struct
Expand Down
2 changes: 1 addition & 1 deletion micropython/drivers/sensor/hts221/manifest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
metadata(description="HTS221 temperature/humidity sensor driver.", version="0.1.0")
metadata(description="HTS221 temperature/humidity sensor driver.", version="0.1.1")

module("hts221.py", opt=3)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import requests

r = requests.get("http://api.xively.com/")
r = requests.get("https://dummyjson.com/quotes/1")
print(r)
print(r.content)
print(r.text)
Expand Down
24 changes: 12 additions & 12 deletions python-stdlib/cmd/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
1. End of file on input is processed as the command 'EOF'.
2. A command is parsed out of each line by collecting the prefix composed
of characters in the identchars member.
3. A command `foo' is dispatched to a method 'do_foo()'; the do_ method
3. A command 'foo' is dispatched to a method 'do_foo()'; the do_ method
is passed a single argument consisting of the remainder of the line.
4. Typing an empty line repeats the last command. (Actually, it calls the
method `emptyline', which may be overridden in a subclass.)
5. There is a predefined `help' method. Given an argument `topic', it
calls the command `help_topic'. With no arguments, it lists all topics
method 'emptyline', which may be overridden in a subclass.)
5. There is a predefined 'help' method. Given an argument 'topic', it
calls the command 'help_topic'. With no arguments, it lists all topics
with defined help_ functions, broken into up to three topics; documented
commands, miscellaneous help topics, and undocumented commands.
6. The command '?' is a synonym for `help'. The command '!' is a synonym
for `shell', if a do_shell method exists.
6. The command '?' is a synonym for 'help'. The command '!' is a synonym
for 'shell', if a do_shell method exists.
7. If completion is enabled, completing commands will be done automatically,
and completing of commands args is done by calling complete_foo() with
arguments text, line, begidx, endidx. text is string we are matching
Expand All @@ -23,21 +23,21 @@
indexes of the text being matched, which could be used to provide
different completion depending upon which position the argument is in.

The `default' method may be overridden to intercept commands for which there
The 'default' method may be overridden to intercept commands for which there
is no do_ method.

The `completedefault' method may be overridden to intercept completions for
The 'completedefault' method may be overridden to intercept completions for
commands that have no complete_ method.

The data member `self.ruler' sets the character used to draw separator lines
The data member 'self.ruler' sets the character used to draw separator lines
in the help messages. If empty, no ruler line is drawn. It defaults to "=".

If the value of `self.intro' is nonempty when the cmdloop method is called,
If the value of 'self.intro' is nonempty when the cmdloop method is called,
it is printed out on interpreter startup. This value may be overridden
via an optional argument to the cmdloop() method.

The data members `self.doc_header', `self.misc_header', and
`self.undoc_header' set the headers used for the help function's
The data members 'self.doc_header', 'self.misc_header', and
'self.undoc_header' set the headers used for the help function's
listings of documented functions, miscellaneous topics, and undocumented
functions respectively.

Expand Down
2 changes: 1 addition & 1 deletion python-stdlib/cmd/manifest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
metadata(version="3.4.1")
metadata(version="3.4.2")

module("cmd.py")
4 changes: 2 additions & 2 deletions python-stdlib/contextlib/contextlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
class closing(object):
"""Context to automatically close something at the end of a block.

Code like this:
Code like this::

with closing(<module>.open(<arguments>)) as f:
<block>

is equivalent to this:
is equivalent to this::

f = <module>.open(<arguments>)
try:
Expand Down
2 changes: 1 addition & 1 deletion python-stdlib/contextlib/manifest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
metadata(description="Port of contextlib for micropython", version="3.4.4")
metadata(description="Port of contextlib for MicroPython", version="3.4.5")

require("ucontextlib")
require("collections")
Expand Down
2 changes: 1 addition & 1 deletion python-stdlib/copy/copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def deepcopy(x, memo=None, _nil=[]):
if copier:
y = copier(memo)
else:
reductor = dispatch_table.get(cls)
reductor = _deepcopy_dispatch.get(cls)
if reductor:
rv = reductor(x)
else:
Expand Down
Loading
Loading