docs: Spelling mistakes

pull/2281/merge
Mike Causer 2016-08-01 09:52:00 +10:00 zatwierdzone przez Paul Sokolovsky
rodzic 3eb532e974
commit ce166e6b68
36 zmienionych plików z 60 dodań i 60 usunięć

Wyświetl plik

@ -35,6 +35,6 @@ This can be achieved with:
make MICROPY_PORT=<port_name> latexpdf make MICROPY_PORT=<port_name> latexpdf
but require rather complete install of LaTeX with various extensions. On but require rather complete install of LaTeX with various extensions. On
Debiab/Ubuntu, try (500MB+ download): Debian/Ubuntu, try (500MB+ download):
apt-get install texlive-latex-recommended texlive-latex-extra apt-get install texlive-latex-recommended texlive-latex-extra

Wyświetl plik

@ -52,7 +52,7 @@ For your convenience, some of technical specifications are provided below:
external FlashROM, UART, deep sleep wake-up, etc.) external FlashROM, UART, deep sleep wake-up, etc.)
* UART: One RX/TX UART (no hardware handshaking), one TX-only UART. * UART: One RX/TX UART (no hardware handshaking), one TX-only UART.
* SPI: 2 SPI interfaces (one used for FlashROM). * SPI: 2 SPI interfaces (one used for FlashROM).
* I2C: No native extenal I2C (bitbang implementation available on any pins). * I2C: No native external I2C (bitbang implementation available on any pins).
* I2S: 1. * I2S: 1.
* Programming: using BootROM bootloader from UART. Due to external FlashROM * Programming: using BootROM bootloader from UART. Due to external FlashROM
and always-available BootROM bootloader, ESP8266 is not brickable. and always-available BootROM bootloader, ESP8266 is not brickable.

Wyświetl plik

@ -36,7 +36,7 @@ WebREPL - a prompt over WiFi
WebREPL allows you to use the Python prompt over WiFi, connecting through a WebREPL allows you to use the Python prompt over WiFi, connecting through a
browser. The latest versions of Firefox and Chrome are supported. browser. The latest versions of Firefox and Chrome are supported.
For your convinience, WebREPL client is hosted at For your convenience, WebREPL client is hosted at
`<http://micropython.org/webrepl>`__ . Alternatively, you can install it `<http://micropython.org/webrepl>`__ . Alternatively, you can install it
locally from the the GitHub repository locally from the the GitHub repository
`<https://github.com/micropython/webrepl>`__ . `<https://github.com/micropython/webrepl>`__ .

Wyświetl plik

@ -1,7 +1,7 @@
Builtin Functions Builtin Functions
================= =================
All builtin functions are described here. They are alse available via All builtin functions are described here. They are also available via
``builtins`` module. ``builtins`` module.
.. function:: abs() .. function:: abs()

Wyświetl plik

@ -15,7 +15,7 @@ Functions
Get or set the sleep type. Get or set the sleep type.
If the ``sleep_type`` parameter is provided, sets the sleep type to its If the ``sleep_type`` parameter is provided, sets the sleep type to its
value. If the function is called wihout parameters, returns the current value. If the function is called without parameters, returns the current
sleep type. sleep type.
The possible sleep types are defined as constants: The possible sleep types are defined as constants:

Wyświetl plik

@ -84,7 +84,7 @@ Methods
- ``None`` - no pull up or down resistor. - ``None`` - no pull up or down resistor.
- ``Pin.PULL_UP`` - pull up resistor enabled. - ``Pin.PULL_UP`` - pull up resistor enabled.
- ``Pin.PULL_DOWN`` - pull down resitor enabled. - ``Pin.PULL_DOWN`` - pull down resistor enabled.
- ``drive`` can be one of: - ``drive`` can be one of:

Wyświetl plik

@ -39,7 +39,7 @@ Methods
.. method:: RTC.alarm(id, time, /*, repeat=False) .. method:: RTC.alarm(id, time, /*, repeat=False)
Set the RTC alarm. Time might be either a milllisecond value to program the alarm to Set the RTC alarm. Time might be either a millisecond value to program the alarm to
current time + time_in_ms in the future, or a datetimetuple. If the time passed is in current time + time_in_ms in the future, or a datetimetuple. If the time passed is in
milliseconds, repeat can be set to ``True`` to make the alarm periodic. milliseconds, repeat can be set to ``True`` to make the alarm periodic.

Wyświetl plik

@ -45,7 +45,7 @@ Methods
respectively. respectively.
- ``bits`` is the width of each transfer, accepted values are 8, 16 and 32. - ``bits`` is the width of each transfer, accepted values are 8, 16 and 32.
- ``firstbit`` can be ``SPI.MSB`` only. - ``firstbit`` can be ``SPI.MSB`` only.
- ``pins`` is an optional tupple with the pins to assign to the SPI bus. - ``pins`` is an optional tuple with the pins to assign to the SPI bus.
.. method:: SPI.deinit() .. method:: SPI.deinit()

Wyświetl plik

@ -104,7 +104,7 @@ Methods
If only a channel identifier passed, then a previously initialized channel If only a channel identifier passed, then a previously initialized channel
object is returned (or ``None`` if there is no previous channel). object is returned (or ``None`` if there is no previous channel).
Othwerwise, a TimerChannel object is initialized and returned. Otherwise, a TimerChannel object is initialized and returned.
The operating mode is is the one configured to the Timer object that was used to The operating mode is is the one configured to the Timer object that was used to
create the channel. create the channel.
@ -152,7 +152,7 @@ Methods
.. method:: timerchannel.irq(\*, trigger, priority=1, handler=None) .. method:: timerchannel.irq(\*, trigger, priority=1, handler=None)
The behavior of this callback is heaviliy dependent on the operating The behavior of this callback is heavily dependent on the operating
mode of the timer channel: mode of the timer channel:
- If mode is ``Timer.PERIODIC`` the callback is executed periodically - If mode is ``Timer.PERIODIC`` the callback is executed periodically

Wyświetl plik

@ -167,7 +167,7 @@ Methods
.. data:: UART.EVEN .. data:: UART.EVEN
.. data:: UART.ODD .. data:: UART.ODD
parity types (anlong with ``None``) parity types (along with ``None``)
.. data:: UART.RX_ANY .. data:: UART.RX_ANY

Wyświetl plik

@ -57,7 +57,7 @@ Power related functions
Gates the clock to the CPU, useful to reduce power consumption at any time during Gates the clock to the CPU, useful to reduce power consumption at any time during
short or long periods. Peripherals continue working and execution resumes as soon short or long periods. Peripherals continue working and execution resumes as soon
as any interrupt is triggered (on many ports this includes system timer as any interrupt is triggered (on many ports this includes system timer
interrupt occuring at regular intervals on the order of millisecond). interrupt occurring at regular intervals on the order of millisecond).
.. function:: sleep() .. function:: sleep()
@ -96,7 +96,7 @@ Miscellaneous functions
.. function:: unique_id() .. function:: unique_id()
Returns a byte string with a unique idenifier of a board/SoC. It will vary Returns a byte string with a unique identifier of a board/SoC. It will vary
from a board/SoC instance to another, if underlying hardware allows. Length from a board/SoC instance to another, if underlying hardware allows. Length
varies by hardware (so use substring of a full value if you expect a short varies by hardware (so use substring of a full value if you expect a short
ID). In some MicroPython ports, ID corresponds to the network MAC address. ID). In some MicroPython ports, ID corresponds to the network MAC address.

Wyświetl plik

@ -237,7 +237,7 @@ For example::
Get or set the PHY mode. Get or set the PHY mode.
If the ``mode`` parameter is provided, sets the mode to its value. If If the ``mode`` parameter is provided, sets the mode to its value. If
the function is called wihout parameters, returns the current mode. the function is called without parameters, returns the current mode.
The possible modes are defined as constants: The possible modes are defined as constants:
* ``MODE_11B`` -- IEEE 802.11b, * ``MODE_11B`` -- IEEE 802.11b,
@ -319,7 +319,7 @@ For example::
* ``STAT_WRONG_PASSWORD`` -- failed due to incorrect password, * ``STAT_WRONG_PASSWORD`` -- failed due to incorrect password,
* ``STAT_NO_AP_FOUND`` -- failed because no access point replied, * ``STAT_NO_AP_FOUND`` -- failed because no access point replied,
* ``STAT_CONNECT_FAIL`` -- failed due to other problems, * ``STAT_CONNECT_FAIL`` -- failed due to other problems,
* ``STAT_GOT_IP`` -- connection susccessful. * ``STAT_GOT_IP`` -- connection successful.
.. method:: wlan.isconnected() .. method:: wlan.isconnected()
@ -329,7 +329,7 @@ For example::
.. method:: wlan.ifconfig([(ip, subnet, gateway, dns)]) .. method:: wlan.ifconfig([(ip, subnet, gateway, dns)])
Get/set IP-level network interface paremeters: IP address, subnet mask, Get/set IP-level network interface parameters: IP address, subnet mask,
gateway and DNS server. When called with no arguments, this method returns gateway and DNS server. When called with no arguments, this method returns
a 4-tuple with the above information. To set the above values, pass a a 4-tuple with the above information. To set the above values, pass a
4-tuple with the required information. For example:: 4-tuple with the required information. For example::
@ -343,8 +343,8 @@ For example::
with additional parameters beyond standard IP configuration (as dealt with by with additional parameters beyond standard IP configuration (as dealt with by
``wlan.ifconfig()``). These include network-specific and hardware-specific ``wlan.ifconfig()``). These include network-specific and hardware-specific
parameters. For setting parameters, keyword argument syntax should be used, parameters. For setting parameters, keyword argument syntax should be used,
multiple parameters can be set at once. For querying, paremeters name should multiple parameters can be set at once. For querying, parameters name should
be quoted as a string, and only one paramter can be queries at time:: be quoted as a string, and only one parameter can be queries at time::
# Set WiFi access point name (formally known as ESSID) and WiFi channel # Set WiFi access point name (formally known as ESSID) and WiFi channel
ap.config(essid='My AP', channel=11) ap.config(essid='My AP', channel=11)
@ -397,7 +397,7 @@ For example::
.. note:: .. note::
The ``WLAN`` constructor is special in the sense that if no arguments besides the id are given, The ``WLAN`` constructor is special in the sense that if no arguments besides the id are given,
it will return the already exisiting ``WLAN`` instance without re-configuring it. This is it will return the already existing ``WLAN`` instance without re-configuring it. This is
because ``WLAN`` is a system feature of the WiPy. If the already existing instance is not because ``WLAN`` is a system feature of the WiPy. If the already existing instance is not
initialized it will do the same as the other constructors an will initialize it with default initialized it will do the same as the other constructors an will initialize it with default
values. values.

Wyświetl plik

@ -13,7 +13,7 @@ class ADC -- analog to digital conversion
adc = pyb.ADC(pin) # create an analog object from a pin adc = pyb.ADC(pin) # create an analog object from a pin
val = adc.read() # read an analog value val = adc.read() # read an analog value
adc = pyb.ADCAll(resolution) # creale an ADCAll object adc = pyb.ADCAll(resolution) # create an ADCAll object
val = adc.read_channel(channel) # read the given channel val = adc.read_channel(channel) # read the given channel
val = adc.read_core_temp() # read MCU temperature val = adc.read_core_temp() # read MCU temperature
val = adc.read_core_vbat() # read MCU VBAT val = adc.read_core_vbat() # read MCU VBAT

Wyświetl plik

@ -79,7 +79,7 @@ Methods
.. method:: DAC.triangle(freq) .. method:: DAC.triangle(freq)
Generate a triangle wave. The value on the DAC output changes at Generate a triangle wave. The value on the DAC output changes at
the given frequency, and the frequence of the repeating triangle wave the given frequency, and the frequency of the repeating triangle wave
itself is 2048 times smaller. itself is 2048 times smaller.
.. method:: DAC.write(value) .. method:: DAC.write(value)

Wyświetl plik

@ -7,7 +7,7 @@ class ExtInt -- configure I/O pins to interrupt on external events
There are a total of 22 interrupt lines. 16 of these can come from GPIO pins There are a total of 22 interrupt lines. 16 of these can come from GPIO pins
and the remaining 6 are from internal sources. and the remaining 6 are from internal sources.
For lines 0 thru 15, a given line can map to the corresponding line from an For lines 0 through 15, a given line can map to the corresponding line from an
arbitrary port. So line 0 can map to Px0 where x is A, B, C, ... and arbitrary port. So line 0 can map to Px0 where x is A, B, C, ... and
line 1 can map to Px1 where x is A, B, C, ... :: line 1 can map to Px1 where x is A, B, C, ... ::
@ -27,7 +27,7 @@ explanation, along with various techniques for debouncing.
Trying to register 2 callbacks onto the same pin will throw an exception. Trying to register 2 callbacks onto the same pin will throw an exception.
If pin is passed as an integer, then it is assumed to map to one of the If pin is passed as an integer, then it is assumed to map to one of the
internal interrupt sources, and must be in the range 16 thru 22. internal interrupt sources, and must be in the range 16 through 22.
All other pin objects go through the pin mapper to come up with one of the All other pin objects go through the pin mapper to come up with one of the
gpio pins. :: gpio pins. ::

Wyświetl plik

@ -39,7 +39,7 @@ Printing the i2c object gives you information about its configuration.
You can specify a timeout (in ms):: You can specify a timeout (in ms)::
i2c.send(b'123', timeout=2000) # timout after 2 seconds i2c.send(b'123', timeout=2000) # timeout after 2 seconds
A master must specify the recipient's address:: A master must specify the recipient's address::

Wyświetl plik

@ -231,7 +231,7 @@ Constants
class PinAF -- Pin Alternate Functions class PinAF -- Pin Alternate Functions
====================================== ======================================
A Pin represents a physical pin on the microcprocessor. Each pin A Pin represents a physical pin on the microprocessor. Each pin
can have a variety of functions (GPIO, I2C SDA, etc). Each PinAF can have a variety of functions (GPIO, I2C SDA, etc). Each PinAF
object represents a particular function for a pin. object represents a particular function for a pin.
@ -240,7 +240,7 @@ Constants
x3 = pyb.Pin.board.X3 x3 = pyb.Pin.board.X3
x3_af = x3.af_list() x3_af = x3.af_list()
x3_af will now contain an array of PinAF objects which are availble on x3_af will now contain an array of PinAF objects which are available on
pin X3. pin X3.
For the pyboard, x3_af would contain: For the pyboard, x3_af would contain:

Wyświetl plik

@ -73,7 +73,7 @@ Methods
value, which is an integer in the range [-511 : 512]. With one value, which is an integer in the range [-511 : 512]. With one
argument it sets the RTC calibration. argument it sets the RTC calibration.
The RTC Smooth Calibration mechanism addjusts the RTC clock rate by The RTC Smooth Calibration mechanism adjusts the RTC clock rate by
adding or subtracting the given number of ticks from the 32768 Hz adding or subtracting the given number of ticks from the 32768 Hz
clock over a 32 second period (corresponding to 2^20 clock ticks.) clock over a 32 second period (corresponding to 2^20 clock ticks.)
Each tick added will speed up the clock by 1 part in 2^20, or 0.954 Each tick added will speed up the clock by 1 part in 2^20, or 0.954

Wyświetl plik

@ -78,7 +78,7 @@ Methods
Keyword arguments: Keyword arguments:
- ``freq`` --- specifies the periodic frequency of the timer. You migh also - ``freq`` --- specifies the periodic frequency of the timer. You might also
view this as the frequency with which the timer goes through one complete cycle. view this as the frequency with which the timer goes through one complete cycle.
- ``prescaler`` [0-0xffff] - specifies the value to be loaded into the - ``prescaler`` [0-0xffff] - specifies the value to be loaded into the
@ -97,7 +97,7 @@ Methods
- ``Timer.UP`` - configures the timer to count from 0 to ARR (default) - ``Timer.UP`` - configures the timer to count from 0 to ARR (default)
- ``Timer.DOWN`` - configures the timer to count from ARR down to 0. - ``Timer.DOWN`` - configures the timer to count from ARR down to 0.
- ``Timer.CENTER`` - confgures the timer to count from 0 to ARR and - ``Timer.CENTER`` - configures the timer to count from 0 to ARR and
then back down to 0. then back down to 0.
- ``div`` can be one of 1, 2, or 4. Divides the timer clock to determine - ``div`` can be one of 1, 2, or 4. Divides the timer clock to determine
@ -109,7 +109,7 @@ Methods
transitions on complimentary channels (both channels will be inactive) transitions on complimentary channels (both channels will be inactive)
for this time). ``deadtime`` may be an integer between 0 and 1008, with for this time). ``deadtime`` may be an integer between 0 and 1008, with
the following restrictions: 0-128 in steps of 1. 128-256 in steps of the following restrictions: 0-128 in steps of 1. 128-256 in steps of
2, 256-512 in steps of 8, and 512-1008 in steps of 16. ``deadime`` 2, 256-512 in steps of 8, and 512-1008 in steps of 16. ``deadtime``
measures ticks of ``source_freq`` divided by ``div`` clock ticks. measures ticks of ``source_freq`` divided by ``div`` clock ticks.
``deadtime`` is only available on timers 1 and 8. ``deadtime`` is only available on timers 1 and 8.
@ -141,7 +141,7 @@ Methods
If only a channel number is passed, then a previously initialized channel If only a channel number is passed, then a previously initialized channel
object is returned (or ``None`` if there is no previous channel). object is returned (or ``None`` if there is no previous channel).
Othwerwise, a TimerChannel object is initialized and returned. Otherwise, a TimerChannel object is initialized and returned.
Each channel can be configured to perform pwm, output compare, or Each channel can be configured to perform pwm, output compare, or
input capture. All channels share the same underlying timer, which means input capture. All channels share the same underlying timer, which means
@ -183,7 +183,7 @@ Methods
- ``polarity`` can be one of: - ``polarity`` can be one of:
- ``Timer.HIGH`` - output is active high - ``Timer.HIGH`` - output is active high
- ``Timer.LOW`` - output is acive low - ``Timer.LOW`` - output is active low
Optional keyword arguments for Timer.IC modes: Optional keyword arguments for Timer.IC modes:

Wyświetl plik

@ -46,7 +46,7 @@ Time related functions
Returns the number of milliseconds which have elapsed since ``start``. Returns the number of milliseconds which have elapsed since ``start``.
This function takes care of counter wrap, and always returns a positive This function takes care of counter wrap, and always returns a positive
number. This means it can be used to measure periods upto about 12.4 days. number. This means it can be used to measure periods up to about 12.4 days.
Example:: Example::
@ -59,7 +59,7 @@ Time related functions
Returns the number of microseconds which have elapsed since ``start``. Returns the number of microseconds which have elapsed since ``start``.
This function takes care of counter wrap, and always returns a positive This function takes care of counter wrap, and always returns a positive
number. This means it can be used to measure periods upto about 17.8 minutes. number. This means it can be used to measure periods up to about 17.8 minutes.
Example:: Example::

Wyświetl plik

@ -17,7 +17,7 @@ Functions
.. admonition:: Difference to CPython .. admonition:: Difference to CPython
:class: attention :class: attention
If additional argument, `sep` is supplied, it is used as a seperator If additional argument, `sep` is supplied, it is used as a separator
between hexadecimal values. between hexadecimal values.
.. function:: unhexlify(data) .. function:: unhexlify(data)

Wyświetl plik

@ -13,10 +13,10 @@ Classes
.. function:: namedtuple(name, fields) .. function:: namedtuple(name, fields)
This is factory function to create a new namedtuple type with a specific This is factory function to create a new namedtuple type with a specific
name and set of fields. A namedtyple is a subclass of tuple which allows name and set of fields. A namedtuple is a subclass of tuple which allows
to access its fields not just by numeric index, but also with an attribute to access its fields not just by numeric index, but also with an attribute
access syntax using symbolic field names. Fields is a sequence of strings access syntax using symbolic field names. Fields is a sequence of strings
specifying field names. For compatibily with CPython it can also be a specifying field names. For compatibility with CPython it can also be a
a string with space-separated field named (but this is less efficient). a string with space-separated field named (but this is less efficient).
Example of use:: Example of use::

Wyświetl plik

@ -118,7 +118,7 @@ Module contents
.. data:: BIG_ENDIAN .. data:: BIG_ENDIAN
Layour type for a big-endian packed structure. Layout type for a big-endian packed structure.
.. data:: NATIVE .. data:: NATIVE
@ -184,7 +184,7 @@ Subscripting a pointer with other integer values but 0 are supported too,
with the same semantics as in C. with the same semantics as in C.
Summing up, accessing structure fields generally follows C syntax, Summing up, accessing structure fields generally follows C syntax,
except for pointer derefence, when you need to use ``[0]`` operator except for pointer dereference, when you need to use ``[0]`` operator
instead of ``*``. instead of ``*``.
Limitations Limitations

Wyświetl plik

@ -9,7 +9,7 @@
This module implements binary data hashing algorithms. Currently, it This module implements binary data hashing algorithms. Currently, it
implements SHA256 algorithm. Choosing SHA256 was a deliberate choice, implements SHA256 algorithm. Choosing SHA256 was a deliberate choice,
as a modern, cryptographically secure algorithm. This means that a as a modern, cryptographically secure algorithm. This means that a
single algorithm can cover both usecases of "any hash algorithm" and single algorithm can cover both use cases of "any hash algorithm" and
security-related usage, and thus save space omitting legacy algorithms security-related usage, and thus save space omitting legacy algorithms
like MD5 or SHA1. like MD5 or SHA1.
@ -53,7 +53,7 @@ Constructors
Example:: Example::
hash = uhashlib.sha1('abcd1234', 1001) # lenght of the initial piece is multiple of 4 bytes hash = uhashlib.sha1('abcd1234', 1001) # length of the initial piece is multiple of 4 bytes
hash.update('1234') # also multiple of 4 bytes hash.update('1234') # also multiple of 4 bytes
... ...
hash.update('12345') # last chunk may be of any length hash.update('12345') # last chunk may be of any length
@ -68,7 +68,7 @@ Methods
.. method:: hash.digest() .. method:: hash.digest()
Return hash for all data passed thru hash, as a bytes object. After this Return hash for all data passed through hash, as a bytes object. After this
method is called, more data cannot be fed into hash any longer. method is called, more data cannot be fed into hash any longer.
.. only:: port_wipy .. only:: port_wipy

Wyświetl plik

@ -12,7 +12,7 @@ Functions
.. function:: open(name, mode='r', **kwargs) .. function:: open(name, mode='r', **kwargs)
Open a file. Builtin ``open()`` function is alised to this function. Open a file. Builtin ``open()`` function is aliased to this function.
All ports (which provide access to file system) are required to support All ports (which provide access to file system) are required to support
`mode` parameter, but support for other arguments vary by port. `mode` parameter, but support for other arguments vary by port.

Wyświetl plik

@ -81,7 +81,7 @@ Functions
.. function:: unmount(path) .. function:: unmount(path)
Unmounts a prevoulsy mounted block device from the given path. Unmounts a previously mounted block device from the given path.
.. function:: mkfs(block_device or path) .. function:: mkfs(block_device or path)

Wyświetl plik

@ -117,7 +117,7 @@ Functions
.. function:: time() .. function:: time()
Returns the number of seconds, as an integer, since the Epoch, assuming that underlying Returns the number of seconds, as an integer, since the Epoch, assuming that underlying
RTC is set and maintained as decsribed above. If an RTC is not set, this function returns RTC is set and maintained as described above. If an RTC is not set, this function returns
number of seconds since a port-specific reference point in time (for embedded boards without number of seconds since a port-specific reference point in time (for embedded boards without
a battery-backed RTC, usually since power up or reset). If you want to develop portable a battery-backed RTC, usually since power up or reset). If you want to develop portable
MicroPython application, you should not rely on this function to provide higher than second MicroPython application, you should not rely on this function to provide higher than second

Wyświetl plik

@ -95,7 +95,7 @@ We set up timer 2 as follows::
The prescaler is set at 83, which makes this timer count at 1 MHz. The prescaler is set at 83, which makes this timer count at 1 MHz.
This is because the CPU clock, running at 168 MHz, is divided by This is because the CPU clock, running at 168 MHz, is divided by
2 and then by prescaler+1, giving a freqency of 168 MHz/2/(83+1)=1 MHz 2 and then by prescaler+1, giving a frequency of 168 MHz/2/(83+1)=1 MHz
for timer 2. The period is set to a large number so that the timer for timer 2. The period is set to a large number so that the timer
can count up to a large number before wrapping back around to zero. can count up to a large number before wrapping back around to zero.
In this case it will take about 17 minutes before it cycles back to In this case it will take about 17 minutes before it cycles back to

Wyświetl plik

@ -61,7 +61,7 @@ The first argument to the function ``osc`` is the number of mouse events to send
and the second argument is the delay (in milliseconds) between events. Try and the second argument is the delay (in milliseconds) between events. Try
playing around with different numbers. playing around with different numbers.
**Excercise: make the mouse go around in a circle.** **Exercise: make the mouse go around in a circle.**
Making a mouse with the accelerometer Making a mouse with the accelerometer
------------------------------------- -------------------------------------
@ -85,14 +85,14 @@ the [safe mode tutorial](tut-reset), but we repeat the instructions here:
3. The LEDs will then cycle green to orange to green+orange and back again. 3. The LEDs will then cycle green to orange to green+orange and back again.
4. Keep holding down USR until *only the orange LED is lit*, and then let 4. Keep holding down USR until *only the orange LED is lit*, and then let
go of the USR switch. go of the USR switch.
5. The orange LED should flash quickly 4 times, and then turn off. 5. The orange LED should flash quickly 4 times, and then turn off.
6. You are now in safe mode. 6. You are now in safe mode.
In safe mode, the ``boot.py`` and ``main.py`` files are not executed, and so In safe mode, the ``boot.py`` and ``main.py`` files are not executed, and so
the pyboard boots up with default settings. This means you now have access the pyboard boots up with default settings. This means you now have access
to the filesystem (the USB drive should appear), and you can edit ``main.py``. to the filesystem (the USB drive should appear), and you can edit ``main.py``.
(Leave ``boot.py`` as-is, because we still want to go back to HID-mode after (Leave ``boot.py`` as-is, because we still want to go back to HID-mode after
we finish editting ``main.py``.) we finish editing ``main.py``.)
In ``main.py`` put the following code:: In ``main.py`` put the following code::

Wyświetl plik

@ -129,7 +129,7 @@ Non-integer data types
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
These may be handled by means of arrays of the appropriate data type. For These may be handled by means of arrays of the appropriate data type. For
example, single precison floating point data may be processed as follows. example, single precision floating point data may be processed as follows.
This code example takes an array of floats and replaces its contents with This code example takes an array of floats and replaces its contents with
their squares. their squares.
@ -172,7 +172,7 @@ thus:
The const() construct causes MicroPython to replace the variable name The const() construct causes MicroPython to replace the variable name
with its value at compile time. If constants are declared in an outer with its value at compile time. If constants are declared in an outer
Python scope they can be shared between mutiple assembler functions and Python scope they can be shared between multiple assembler functions and
with Python code. with Python code.
Assembler code as class methods Assembler code as class methods

Wyświetl plik

@ -23,7 +23,7 @@ specifiers:
* ne Not equal * ne Not equal
* cs Carry set * cs Carry set
* cc Carry clear * cc Carry clear
* mi Minus (negaive) * mi Minus (negative)
* pl Plus (positive) * pl Plus (positive)
* vs Overflow set * vs Overflow set
* vc Overflow clear * vc Overflow clear

Wyświetl plik

@ -24,7 +24,7 @@ This summarises the points detailed below and lists the principal recommendation
* Where an ISR returns multiple bytes use a pre-allocated ``bytearray``. If multiple integers are to be * Where an ISR returns multiple bytes use a pre-allocated ``bytearray``. If multiple integers are to be
shared between an ISR and the main program consider an array (``array.array``). shared between an ISR and the main program consider an array (``array.array``).
* Where data is shared between the main program and an ISR, consider disabling interrupts prior to accessing * Where data is shared between the main program and an ISR, consider disabling interrupts prior to accessing
the data in the main program and re-enabling them immediately afterwards (see Critcal Sections). the data in the main program and re-enabling them immediately afterwards (see Critical Sections).
* Allocate an emergency exception buffer (see below). * Allocate an emergency exception buffer (see below).

Wyświetl plik

@ -50,7 +50,7 @@ Finally type ``print(i)``, press RETURN, press BACKSPACE and press RETURN again:
>>> >>>
Auto-indent won't be applied if the previous two lines were all spaces. This Auto-indent won't be applied if the previous two lines were all spaces. This
means that you can finish entering a compound statment by pressing RETURN means that you can finish entering a compound statement by pressing RETURN
twice, and then a third press will finish and execute. twice, and then a third press will finish and execute.
Auto-completion Auto-completion
@ -80,7 +80,7 @@ expansions:
Interrupting a running program Interrupting a running program
------------------------------ ------------------------------
You can interupt a running program by pressing Ctrl-C. This will raise a KeyboardInterrupt You can interrupt a running program by pressing Ctrl-C. This will raise a KeyboardInterrupt
which will bring you back to the REPL, providing your program doesn't intercept the which will bring you back to the REPL, providing your program doesn't intercept the
KeyboardInterrupt exception. KeyboardInterrupt exception.
@ -184,8 +184,8 @@ variables no longer exist:
The special variable _ (underscore) The special variable _ (underscore)
----------------------------------- -----------------------------------
When you use the REPL, you may perfom computations and see the results. When you use the REPL, you may perform computations and see the results.
MicroPython stores the results of the previous statment in the variable _ (underscore). MicroPython stores the results of the previous statement in the variable _ (underscore).
So you can use the underscore to save the result in a variable. For example: So you can use the underscore to save the result in a variable. For example:
>>> 1 + 2 + 3 + 4 + 5 >>> 1 + 2 + 3 + 4 + 5

Wyświetl plik

@ -16,7 +16,7 @@ Before applying power
.. warning:: .. warning::
The GPIO pins of the WiPy are NOT 5V tolerant, connecting them to voltages higer The GPIO pins of the WiPy are NOT 5V tolerant, connecting them to voltages higher
than 3.6V will cause irreparable damage to the board. ADC pins, when configured than 3.6V will cause irreparable damage to the board. ADC pins, when configured
in analog mode cannot withstand voltages above 1.8V. Keep these considerations in in analog mode cannot withstand voltages above 1.8V. Keep these considerations in
mind when wiring your electronics. mind when wiring your electronics.

Wyświetl plik

@ -205,7 +205,7 @@ See :ref:`network.Server <network.Server>` ::
server = Server(login=('user', 'password'), timeout=60) server = Server(login=('user', 'password'), timeout=60)
server.timeout(300) # change the timeout server.timeout(300) # change the timeout
server.timeout() # get the timeout server.timeout() # get the timeout
server.isrunning() # check wether the server is running or not server.isrunning() # check whether the server is running or not
Heart beat LED Heart beat LED
-------------- --------------

Wyświetl plik

@ -17,7 +17,7 @@ Because the WiPy/expansion board does not have a housing it needs a bit of care:
If you experience a lot of static electricity in your area (eg dry and cold If you experience a lot of static electricity in your area (eg dry and cold
climates), take extra care not to shock the WiPy. If your WiPy came climates), take extra care not to shock the WiPy. If your WiPy came
in a ESD bag, then this bag is the best way to store and carry the in a ESD bag, then this bag is the best way to store and carry the
WiPy as it will protect it agains static discharges. WiPy as it will protect it against static discharges.
As long as you take care of the hardware, you should be okay. It's almost As long as you take care of the hardware, you should be okay. It's almost
impossible to break the software on the WiPy, so feel free to play around impossible to break the software on the WiPy, so feel free to play around