mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-15 11:04:55 +00:00
The doc/api is a legacy name, which is confusing in the current use, since all build targets are now APIs. Today we have: doc/common: Common configuration and settings between all targets. doc/main: Main Pybricks documentation at docs.pybricks.com. doc/ide: Documentation shipped with the Pybricks Code IDE.
32 lines
681 B
ReStructuredText
32 lines
681 B
ReStructuredText
Force Sensor
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
.. figure:: ../../main/images/sensor_force.png
|
|
:width: 35 %
|
|
|
|
.. autoclass:: pybricks.pupdevices.ForceSensor
|
|
:no-members:
|
|
|
|
.. automethod:: pybricks.pupdevices.ForceSensor.force
|
|
|
|
.. automethod:: pybricks.pupdevices.ForceSensor.distance
|
|
|
|
.. automethod:: pybricks.pupdevices.ForceSensor.pressed
|
|
|
|
.. automethod:: pybricks.pupdevices.ForceSensor.touched
|
|
|
|
Examples
|
|
-------------------
|
|
|
|
Measuring force and movement
|
|
****************************
|
|
|
|
.. literalinclude::
|
|
../../../examples/pup/sensor_force/basics.py
|
|
|
|
Measuring peak force
|
|
********************
|
|
|
|
.. literalinclude::
|
|
../../../examples/pup/sensor_force/peak.py
|