setCaching

open fun setCaching(useCache: Boolean)

Whether to cache readings such that calling a getter will cache the last known value until clearCache is called. This applies for position and velocity getters independently.

WARNING: When using this mode, it is exceedingly important that you clear the cache with clearCache, otherwise your encoder will not report any non-stale data after the first run.

Parameters

useCache

whether to cache reading for position and velocity (separate), default false