Skip to content

Commit

Permalink
Update docs and builtin help with missing information.
Browse files Browse the repository at this point in the history
  • Loading branch information
ntoll committed Jun 20, 2016
1 parent f03f77b commit 67bc2d0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
13 changes: 13 additions & 0 deletions docs/display.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ Functions
Note that the ``wait``, ``loop`` and ``monospace`` arguments must be specified
using their keyword.

.. py:function:: on()
Use on() to turn on the display.

.. py:function:: off()
Use off() to turn off the display (thus allowing you to re-use the GPIO
pins associated with the display for other purposes).

.. py:function:: is_on()
Returns ``True`` if the display is on, otherwise returns ``False``.

Example
=======

Expand Down
9 changes: 9 additions & 0 deletions docs/image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ Classes
Return a new image by cropping the picture to a width of ``w`` and a
height of ``h``, starting with the pixel at column ``x`` and row ``y``.

.. py:method:: copy()
Return an exact copy of the image.

.. py:method:: invert()
Return a new image by inverting the brightness of the pixels in the
source image.


Attributes
==========
Expand Down
1 change: 1 addition & 0 deletions inc/microbit/modmicrobit.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ MP_DECLARE_CONST_FUN_OBJ(microbit_button_is_pressed_obj);
MP_DECLARE_CONST_FUN_OBJ(microbit_button_was_pressed_obj);
MP_DECLARE_CONST_FUN_OBJ(microbit_button_get_presses_obj);
MP_DECLARE_CONST_FUN_OBJ(microbit_compass_is_calibrated_obj);
MP_DECLARE_CONST_FUN_OBJ(microbit_compass_heading_obj);
MP_DECLARE_CONST_FUN_OBJ(microbit_compass_calibrate_obj);
MP_DECLARE_CONST_FUN_OBJ(microbit_compass_is_calibrating_obj);
MP_DECLARE_CONST_FUN_OBJ(microbit_compass_clear_calibration_obj);
Expand Down
3 changes: 2 additions & 1 deletion source/microbit/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ STATIC const mp_doc_t help_table_instances[] = {
{&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"},
{&microbit_button_get_presses_obj, "Use get_presses() to get the running total of button presses, and also\nreset this counter to zero.\n"},
// Compass 3D direction heading
{&microbit_compass_heading_obj, "Gives a compass heading between 0-360 with 0 as north.\n"},
{&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"},
{&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"},
{&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"},
{&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"},
{&microbit_compass_clear_calibration_obj, "Reset micro:bit's compass using clear_calibration() command.\nRun calibrate() to improve accuracy.\n"},
{&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"},
{&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"},
Expand Down

0 comments on commit 67bc2d0

Please sign in to comment.