Precision is slower, but more precise and can be used on longer ranges. The ranging_protocol is a new feature that allows changing between two ranging protocols: POZYX_RANGE_PROTOCOL_FAST and POZYX_RANGE_PROTOCOL_PRECISION. remote_id and remote will allow measuring the distance between two remote Pozyx devices, and will be explained at the end of this tutorial, so don't change those for now. Optionally, you can change the range_step_mm as well, which will make the distance range indicated by the LEDs either higher or lower depending on your change. You’ll have to change the destination_id parameter to the ID of your destination Pozyx. Uint16_t remote_id = 0圆05D // the network ID of the remote deviceīool remote = false // whether to use the given remote device for ranging Uint8_t ranging_protocol = POZYX_RANGE_PROTOCOL_PRECISION // the ranging protocol to use. Signed int range_step_mm = 1000 // distance between each LED lighting up. At the top of the Arduino sketch, we find the sketch’s parameters:ĬODE uint16_t destination_id = 0圆670 // the network ID of the ranging destination You also have to set the Arduino IDE’s serial monitor’s baudrate to 115200. To see the tutorial in action before we delve into the code, the parameters will need to be changed to match your destination device's ID. The LEDs' changes with respect to the distance is sketched in the figure below: Plug and play The destination Pozyx's LEDs will be doing the same, commanded by our local Pozyx. In this example, the distance between the two devices is measured and the onboard LEDs will show in which range the devices are to each other. If all tools are installed, open up the ready to range example in the Arduino IDE under File > Examples > Pozyx > ready_to_range. Remember that we recommend the Arduino Uno Rev. This example requires two Pozyx devices and one supported Arduino device. If you haven’t read the getting started, please do so and install the necessary tools and libraries. This is the first general Pozyx tutorial for the Creator system.
0 Comments
Leave a Reply. |