Header file for the wheel encoder drivers. More...
#include "pico/stdlib.h"
Go to the source code of this file.
Data Structures | |
struct | wheel_encoder |
Struct to store global encoder data. More... | |
Typedefs | |
typedef struct wheel_encoder | wheel_encoder_t |
Struct to store global encoder data. More... | |
Functions | |
float | wheel_enc_get_speed (float time_elapsed, bool is_pulse) |
Get the speed in either pulses/second or mm/second. More... | |
float | wheel_enc_get_time_diff (uint64_t current_time, uint64_t prev_time) |
Get the time difference in ms. More... | |
Header file for the wheel encoder drivers.
typedef struct wheel_encoder wheel_encoder_t |
Struct to store global encoder data.
float wheel_enc_get_speed | ( | float | time_elapsed, |
bool | is_pulse | ||
) |
Get the speed in either pulses/second or mm/second.
[in] | time_elapsed | Time elapsed in ms |
[in] | is_pulse | True if speed is in pulses/second, false if speed is in mm/second |
References WHEEL_ENC_DIST_PER_PULSE, and WHEEL_ENC_SEC_TO_MSEC.
float wheel_enc_get_time_diff | ( | uint64_t | current_time, |
uint64_t | prev_time | ||
) |
Get the time difference in ms.
[in] | current_time | Current time in us |
[in] | prev_time | Previous time in us |
References WHEEL_ENC_SEC_TO_MSEC.