Created
September 20, 2018 15:47
-
-
Save jeffkaufman/aca1524bff242308cbb28f00ea74cf68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from yoctopuce.yocto_api import * | |
from yoctopuce.yocto_gyro import * | |
def callback(gyro, roll, pitch, heading): | |
print("gyro: %s" % heading) | |
errmsg = YRefParam() | |
YAPI.RegisterHub("usb", errmsg) | |
YGyro.FirstGyro().registerAnglesCallback(callback) | |
while True: | |
YAPI.Sleep(250, errmsg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment