Pytrack API
This chapter describes the various libraries which are designed for the Pytrack Board. This includes details about the various methods and classes available for each of the Pytrack’s sensors.
3-Axis Accelerometer (LIS2HH12)
Pytrack has a 3-Axis Accelerometer that provides outputs for acceleration as well as roll, pitch and yaw.
Constructors
Creates a LIS2HH12 object, that will return values for acceleration, roll, pitch and yaw. Constructor must be passed a Pytrack or I2C object to successfully construct.
Methods
Read the acceleration from the LIS2HH12. Returns a tuple with the 3 values of acceleration (G).
Read the current roll from the LIS2HH12. Returns a float in degrees.
Read the current pitch from the LIS2HH12. Returns a float in degrees.
Read the current yaw from the LIS2HH12. Returns a float in degrees.
GPS with GLONASS (Quectel L76-L GNSS)
Pytrack has a GPS (with GLONASS) that provides outputs longitude/latitude, speed and other information about the Pytrack's location.
Constructors
Creates a L76GNSS object, that will return values for longitude and latitude. Constructor must be passed a Pytrack or I2C object to successfully construct. Set the timeout
to a time period (in seconds) for the GPS to search for a lock. If a lock is not found by the time the timeout
has expired, the coordinates
method will return (None, None)
.
Methods
Read the longitude and latitude from the L76GNSS. Returns a tuple with the longitude and latitude. With debug
set to True
the output from the GPS is verbose.
Please note that more functionality is being added weekly to these libraries. If a required feature is not available, feel free to contribute with a pull request at the Libraries GitHub repository