Skip to content

Instantly share code, notes, and snippets.

@jeffkaufman
Created September 20, 2018 15:47
Show Gist options
  • Save jeffkaufman/aca1524bff242308cbb28f00ea74cf68 to your computer and use it in GitHub Desktop.
Save jeffkaufman/aca1524bff242308cbb28f00ea74cf68 to your computer and use it in GitHub Desktop.
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