Skip to content

Commit 67bc2d0

Browse files
committed
Update docs and builtin help with missing information.
1 parent f03f77b commit 67bc2d0

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

docs/display.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ Functions
6464
Note that the ``wait``, ``loop`` and ``monospace`` arguments must be specified
6565
using their keyword.
6666

67+
.. py:function:: on()
68+
69+
Use on() to turn on the display.
70+
71+
.. py:function:: off()
72+
73+
Use off() to turn off the display (thus allowing you to re-use the GPIO
74+
pins associated with the display for other purposes).
75+
76+
.. py:function:: is_on()
77+
78+
Returns ``True`` if the display is on, otherwise returns ``False``.
79+
6780
Example
6881
=======
6982

docs/image.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ Classes
9191
Return a new image by cropping the picture to a width of ``w`` and a
9292
height of ``h``, starting with the pixel at column ``x`` and row ``y``.
9393

94+
.. py:method:: copy()
95+
96+
Return an exact copy of the image.
97+
98+
.. py:method:: invert()
99+
100+
Return a new image by inverting the brightness of the pixels in the
101+
source image.
102+
94103

95104
Attributes
96105
==========

inc/microbit/modmicrobit.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ MP_DECLARE_CONST_FUN_OBJ(microbit_button_is_pressed_obj);
167167
MP_DECLARE_CONST_FUN_OBJ(microbit_button_was_pressed_obj);
168168
MP_DECLARE_CONST_FUN_OBJ(microbit_button_get_presses_obj);
169169
MP_DECLARE_CONST_FUN_OBJ(microbit_compass_is_calibrated_obj);
170+
MP_DECLARE_CONST_FUN_OBJ(microbit_compass_heading_obj);
170171
MP_DECLARE_CONST_FUN_OBJ(microbit_compass_calibrate_obj);
171172
MP_DECLARE_CONST_FUN_OBJ(microbit_compass_is_calibrating_obj);
172173
MP_DECLARE_CONST_FUN_OBJ(microbit_compass_clear_calibration_obj);

source/microbit/help.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ STATIC const mp_doc_t help_table_instances[] = {
9090
{&microbit_button_was_pressed_obj, "Use was_pressed() to learn if the button was pressed since the last time\nwas_pressed() was called. Returns True or False.\n"},
9191
{&microbit_button_get_presses_obj, "Use get_presses() to get the running total of button presses, and also\nreset this counter to zero.\n"},
9292
// Compass 3D direction heading
93+
{&microbit_compass_heading_obj, "Gives a compass heading between 0-360 with 0 as north.\n"},
9394
{&microbit_compass_obj, "Use micro:bit's compass to detect the direction it is heading in.\nThe compass can detect magnetic fields.\nIt uses the Earth's magnetic field to detect direction.\n"},
9495
{&microbit_compass_is_calibrated_obj, "If micro:bit's compass is_calibrated() and adjusted for accuracy, return True.\nIf compass hasn't been adjusted for accuracy, return False.\n"},
95-
{&microbit_compass_calibrate_obj, "If micro:bit is confused, calibrate() the compass to adjust the its accuracy.\nWhen calibrating, lie it flat and spin it horizontally. During calibration,\ntry not to tilt the compass up and down.\n"},
96+
{&microbit_compass_calibrate_obj, "If micro:bit is confused, calibrate() the compass to adjust the its accuracy.\nIt will ask you to rotate the device to draw a circle on the display.\n"},
9697
{&microbit_compass_clear_calibration_obj, "Reset micro:bit's compass using clear_calibration() command.\nRun calibrate() to improve accuracy.\n"},
9798
{&microbit_compass_get_x_obj, "Return magnetic field detected along micro:bit's X axis.\nUsually, the compass returns the earth's magnetic field in micro-Tesla units.\nUnless...a strong magnet is nearby!\n"},
9899
{&microbit_compass_get_y_obj, "Return magnetic field detected along micro:bit's Y axis.\nUsually, the compass returns the earth's magnetic field in micro-Tesla units.\nUnless...a strong magnet is nearby!\n"},

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy