examples.rst 829 B

123456789101112131415161718192021222324252627282930313233343536
  1. Examples
  2. ========
  3. This page contains a few examples.
  4. Speaker
  5. -------
  6. .. literalinclude:: ../../examples/flipperzero_speaker_test.py
  7. :language: python
  8. Input
  9. -----
  10. .. literalinclude:: ../../examples/flipperzero_draw_on_input_test.py
  11. :language: python
  12. Tic-Tac-Toe
  13. -----------
  14. .. literalinclude:: ../../examples/tic_tac_toe.py
  15. :language: python
  16. Interrupts
  17. ----------
  18. .. literalinclude:: ../../examples/flipperzero_gpio_interrupt_test.py
  19. :language: python
  20. This example drives an external LED upon interrupts: A rising edge on ``C0`` sets the pin ``A7`` to high, a rising edge on ``C1`` sets the pin ``A7`` to low.
  21. The following schematic circuit diagram shows the hardware setup for this example:
  22. .. figure:: ./assets/gpio_interrupt_circuit.svg
  23. :width: 90%
  24. Hardware setup for the GPIO interrupt example.