Skip to content

Latest commit

 

History

History
116 lines (82 loc) · 4.73 KB

code.rst

File metadata and controls

116 lines (82 loc) · 4.73 KB

API

Time for reading the GiggleBot modules' API.

https://media.giphy.com/media/3ov9jNziFTMfzSumAw/giphy.gif

GiggleBot - Regular Module

The :py:mod:`gigglebot` module should be the go-to module when playing around with the GiggleBot. That's why this is the first module that gets documented in this chapter.

The module, should you want to use it in another firmware instead of using the GiggleBot MicroPython Firmware (that already comes with all the modules in it), can be downloaded from :s3-storage-module:`here <gigglebot.py>` (version |fwversion|).

.. automodule:: gigglebot
   :members:

Distance Sensor

_static/images/ds.jpg

As you can see here, the Distance Sensor is the same sensor used on the GoPiGo3 and on any DexterIndustries board that we support and that has a Grove port with an I2C interface on it.

Because of this, we've spend lots of time trying to make the following API of the Distance Sensor identical to the one in the DI-Sensors documentation :py:class:`di_sensors.distance_sensor.DistanceSensor`, so that the transition from either platform can be as seamless as possible.

The module, should you want to use it in another firmware instead of using the GiggleBot MicroPython Firmware (that already comes with all the modules in it), can be downloaded from :s3-storage-module:`here <distance_sensor.py>` (version |fwversion|).

.. automodule:: distance_sensor
   :members:
   :special-members:
   :exclude-members: __weakref__

Temperature Humidity Pressure Sensor

_static/images/thp.jpg

Just like with the Distance Sensor, the Temperature Humidity Pressure Sensor is the same sensor used on the GoPiGo3 and on any other board that we support.

As a consequence, we tried making the API of the Temperature Humidity Pressure Sensor similar to the one in the DI-Sensors documentation :py:class:`di_sensors.temp_hum_press.TempHumPress`, so that the transition from either platform can be as seamless as possible.

The module, should you want to use it in another firmware instead of using the GiggleBot MicroPython Firmware (that already comes with all the modules in it), can be downloaded from :s3-storage-module:`here <thp.py>` (version |fwversion|).

.. automodule:: thp
    :members:
    :special-members:
    :exclude-members: __weakref__

Light and Color Sensor

_static/images/lcs.jpg

The module, should you want to use it in another firmware instead of using the GiggleBot MicroPython Firmware (that already comes with all the modules in it), can be downloaded from :s3-storage-module:`here <lightcolor.py>` (version |fwversion|).

.. automodule:: lightcolor
    :members: LightColorSensor, known_colors, known_hsv
    :special-members:
    :exclude-members: __weakref__

The above colors were picked from the following color wheel - there are a total of 12 colors hand-picked. All the codenames for these colors are to be found as keys in :py:attr:`~lightcolor.known_colors` and :py:attr:`~lightcolor.known_hsv` dictionaries.

In the following context, the numbers encompassing the wheel represent the Hue of the color. You can go on and read more about Hue and other characteristics of HSV format here.

Note

If you want to come up with your own colour boundaries, check this thread here.

_static/images/ColorWheel.jpg

.. currentmodule:: lightcolor

.. autofunction:: translate_to_hsv
.. autofunction:: guess_color_hsv

GiggleBot - Diagnostic Module

The module, should you want to use it in another firmware instead of using the GiggleBot MicroPython Firmware (that already comes with all the modules in it), can be downloaded from :s3-storage-module:`here <gb_diag.py>` (version |fwversion|).

.. automodule:: gb_diag
   :members:
   :special-members:
   :exclude-members: __weakref__