spinner.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Adafruit_CircuitPython_LIS3DH 作者: adafruit 项目源码 文件源码
def get_position(self, delta):
        # Increment elapsed time and compute the current velocity after a
        # decay of the initial velocity.
        self._elapsed += delta
        current_velocity = self._velocity*math.pow(self._decay, self._elapsed)
        self._position += current_velocity*delta
        # Make sure the position stays within values that range from 0 to <10.
        self._position = math.fmod(self._position, 10.0)
        if self._position < 0.0:
            self._position += 10.0
        return self._position


# Initialize NeoPixels and accelerometer.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号