Skip to content

Commit

Permalink
Updated quick start.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfjlaros committed Jan 30, 2019
1 parent 67ca72c commit a578bfe
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ Please see ReadTheDocs_ for the latest documentation.
Quick start
-----------

Export any function e.g., ``digitalRead()`` using the ``interface()`` function.
Export any function e.g., ``digitalRead()`` and ``digitalWrite()`` using the
``interface()`` function.

.. code:: cpp
Expand All @@ -49,10 +50,11 @@ Export any function e.g., ``digitalRead()`` using the ``interface()`` function.
}
void loop(void) {
interface(digitalRead, "");
interface(digitalRead, "", digitalWrite, "");
}
This function is now available on the host under name ``method2()``.
These functions are now available on the host under name ``method2()`` and
``method3()``.

.. code:: python
Expand All @@ -62,14 +64,17 @@ This function is now available on the host under name ``method2()``.
>>>
>>> interface.method2(8)
0
>>> interface.method3(13, True)
The documentation string can be used to name and describe the method.

.. code:: cpp
interface(
digitalRead,
"digital_read: Read digital pin. @pin: Pin number. @return: Pin value.");
"digital_read: Read digital pin. @pin: Pin number. @return: Pin value.",
digitalWrite,
"digital_write: Write to a digital pin. @pin: Pin number. @value: Pin value.");
This is reflected on the host.

Expand All @@ -87,6 +92,7 @@ This is reflected on the host.
>>> interface.digital_read(8)
0
>>> interface.digital_write(13, True)
Please read :doc:`usage_device` for more information about exporting normal
functions, class member functions and documentation conventions.
Expand Down

0 comments on commit a578bfe

Please sign in to comment.