Pozyx

Accurate positioning

Home > Documentation > Arduino library

Arduino library

The Pozyx Arduino library can be downloaded from github .

The functions in the library can be grouped as follows:


All typedefs

coordinates_t | device_coordinates_t | device_range_t | euler_angles_t | pos_error_t | quaternion_t | sensor_data_t | sensor_raw_t | UWB_settings_t | v3D_float32_t |


Core functions

These are the core library functions which are sufficient for full control of the Pozyx device. They govern the initialization, the interrupts and the i2c communication. This part is specific for the Arduino platform and is currently tested for Arduino Uno. These are the functions that should be adjusted when porting the library to another platform.


Function name
int
begin
Initiates the Pozyx shield.
int
regFunction
Call a register funcion on the connected Pozyx shield.
int
regRead
Read from the registers of the connected Pozyx shield.
int
regWrite
Write to the registers of the connected Pozyx shield.
int
remoteRegFunction
Call a register funcion on a remote Pozyx device (anchor or tag).
int
remoteRegRead
Read from the registers on a remote Pozyx device (anchor or tag).
int
remoteRegWrite
Write to the registers on a remote Pozyx device (anchor or tag).
boolean
waitForFlag
Wait until the Pozyx shields has raised a specfic event flag or until timeout.

System functions

This set of functions allow you to configure general system related properties such as the GPIOs, LEDs, interrupts, etc.

Function name
int
clearConfiguration
Clears the configuration.
int
configInterruptPin
Configure the interrupt pin.
int
getCalibrationStatus
Obtain the calibration status.
int
getConfigModeGPIO
Obtain the pull configuration of a GPIO pin.
int
getConfigPullGPIO
Obtain the pull configuration of a GPIO pin.
int
getErrorCode
Obtain the error code.
int
getFirmwareVersion
Obtain the firmware version.
int
getGPIO
Obtain the digital value on one of the GPIO pins.
int
getHardwareVersion
Obtain hte hardware version.
int
getInterruptMask
Function to obtain the interrupt configuration.
int
getInterruptStatus
Obtain the interrupt status.
int
getNumRegistersSaved
Return the number of register variables saved in flash memory.
int
getSelftest
Obtain the selftest result.
int
getWhoAmI
Obtain the who_am_i value.
bool
isRegisterSaved
Verify if a register content is saved in the flash memory.
void
resetSystem
Trigger a software reset of the Pozyx device.
int
saveConfiguration
Save (part of) the configuration to Flash memory.
int
setConfigGPIO
Configure the GPIOs.
int
setGPIO
Set the digital value on one of the GPIO pins.
int
setInterruptMask
Function to configure the interrupts.
int
setLed
Function for turning the leds on and off.
int
setLedConfig
Configure the LEDs.

Ranging and positioning functions

This group of functions are related to ranging and positioning. They are not grouped in the sensor functions because these functions also require UWB communication.

Function name
int
doPositioning
Obtain the coordinates.
int
doRanging
Trigger ranging with a remote device.
int
doRemotePositioning
Obtain the coordinates of a remote device.
int
doRemoteRanging
Trigger ranging between two remote devivces.
int
getAnchorSelectionMode
Obtain the anchor selection mode.
int
getCoordinates
Obtain the last coordinates of the device.
int
getDeviceRangeInfo
Retrieve stored ranging information.
int
getNumberOfAnchors
Obtain the configured number of anchors used for positioning.
int
getOperationMode
Obtain the operation mode of the device.
int
getPositionAlgorithm
Obtain the configured positioning algorithm.
int
getPositionDimension
Obtain the configured positioning dimension.
int
getPositionError
Obtain the last estimated position error covariance information.
int
getPositioningAnchorIds
Obtain which anchors used for positioning.
String
getSystemError
Get the textual system error.
int
getUpdateInterval
Read the update interval continuous positioning.
int
setCoordinates
Set the coordinates of the device.
int
setOperationMode
Define if the device operates as a tag or an anchor.
int
setPositionAlgorithm
Configure the positioning algorithm.
int
setPositioningAnchorIds
Manually set which anchors to use for positioning.
int
setSelectionOfAnchors
Configure how many anchors are used for positioning and how they are selected.
int
setUpdateInterval
Configure the udpate interval for continuous positioning.

Sensor functions

These are library functions that interact with the Pozyx registers to perform certain actions. For a full overview of all the available registers, please refer to the register overview. These functions are platform-independent and work for every Arduino.

Function name
int
getAcceleration_mg
Obtain the 3D acceleration vector in mg.
int
getAllSensorData
Obtain all sensor data at once.
int
getAngularVelocity_dps
Obtain the 3D angular velocity vector degrees per second.
int
getEulerAngles_deg
Obtain the orientation in Euler angles in degrees.
int
getGravityVector_mg
Obtain the 3D gravity vector in mg.
int
getLinearAcceleration_mg
Obtain the 3D linear acceleration in mg.
int
getMagnetic_uT
Obtain the 3D magnetic field strength vector in ┬ÁTesla.
int
getPressure_Pa
Obtain the atmospheric pressure in Pascal.
int
getQuaternion
Obtain the orientation in quaternions.
int
getSensorMode
Retrieve the configured sensor mode.
int
getTemperature_c
Obtain the temperature in degrees Celcius.
int
setSensorMode
Configure the sensor mode.

Device list functions

Functions that control the device list. The device list holds information such as network id and coordinates about other pozyx devices in the network.

Function name
int
addDevice
Manualy adds a device to the device list.
int
clearDevices
Empty the internal list of devices.
int
doAnchorCalibration
Automatically obtain the relative anchor positions.
int
doDiscovery
Discover Pozyx devices in range.
int
getAnchorIds
Obtain the network IDs from all the anchors in the device list.
int
getDeviceCoordinates
Retrieve the stored coordinates of a device.
int
getDeviceIds
Obtain the network IDs from all the devices in the device list.
int
getDeviceListSize
Obtain the number of devices stored internally.
int
getTagIds
Obtain the network IDs from all the tags in the device list.

Wireless communication functions

Although most functions in the library can be used remotely, these functions are used specifically for wireless communication of your own data.

Function name
int
getLastDataLength
Obtain the number of bytes received.
int
getLastNetworkId
Obtain the network id of the last message.
int
getNetworkId
Obtain the network id of the connected Pozyx device.
int
getTxPower
Obtain the UWB transmission power.
int
getUWBChannel
Get the Ultra-wideband frequency channel.
int
getUWBSettings
Obtain the current UWB settings.
int
readRXBufferData
Read data bytes from receive buffer.
int
sendData
Wirelessly transmit data to a remote pozyx device.
int
sendTXBufferData
Wirelessly transmit data.
int
setNetworkId
Overwrite the network id.
int
setTxPower
configure the UWB transmission power.
int
setUWBChannel
Set the Ultra-wideband frequency channel.
int
setUWBSettings
Overwrite the UWB settings.
int
writeTXBufferData
Write data bytes in the transmit buffer.

Home > Documentation > Arduino library