Simple test
------------

Ensure your device works with this simple test.

.. literalinclude:: ../examples/qwiictwist_simpletest.py
    :caption: examples/qwiictwist_simpletest.py
    :linenos:

Examples
---------

1. Basic Readings - Print number of steps knob has been twisted.

.. literalinclude:: ../examples/example1_basic_readings.py
    :caption: examples/example1_basic_readings.py
    :linenos:

2. Set Color - Set the knob color.

.. literalinclude:: ../examples/example2_set_color.py
    :caption: examples/example2_set_color.py
    :linenos:

3. Crazy Color - Set the knob to random colors.

.. literalinclude:: ../examples/example3_crazy_color.py
    :caption: examples/example3_crazy_color.py
    :linenos:

4. Connect Color - Change the knob color as it is twisted.

.. literalinclude:: ../examples/example4_connect_colors.py
    :caption: examples/example4_connect_colors.py
    :linenos:

5. Timestamps - Show timestamps for when knob is twisted or pressed.

.. literalinclude:: ../examples/example5_timestamps.py
    :caption: examples/example5_timestamps.py
    :linenos:

6. Difference - Show the diffence between encoder counts when knob is twisted.

.. literalinclude:: ../examples/example6_difference.py
    :caption: examples/example6_difference.py
    :linenos:

7. Set Count - Change the encoder count reported when knob is twisted.

.. literalinclude:: ../examples/example7_set_count.py
    :caption: examples/example7_set_count.py
    :linenos:

8. Interrupts - Enable button and twist interrupts.

.. literalinclude:: ../examples/example8_interrupts.py
    :caption: examples/example8_interruptst.py
    :linenos:

9. Change I2C Addres - Change the device I2C address.

.. literalinclude:: ../examples/example9_change_i2c_address.py
    :caption: examples/example9_change_i2c_address.py
    :linenos:

10. I2C Scanner - Scan the IC2 bus for devices.

.. literalinclude:: ../examples/example10_i2c_scanner.py
    :caption: examples/example10_i2c_scanner.py
    :linenos:
