Skip to content

Instantly share code, notes, and snippets.

@jeffkaufman
Created September 19, 2018 16:55
Show Gist options
  • Save jeffkaufman/b84f7fd1f5cd99255ef767f224b65e12 to your computer and use it in GitHub Desktop.
Save jeffkaufman/b84f7fd1f5cd99255ef767f224b65e12 to your computer and use it in GitHub Desktop.
import sys
from yoctopuce.yocto_api import *
from yoctopuce.yocto_tilt import *
def callback(tilt, value):
print("tilt: %s" % value)
errmsg = YRefParam()
YAPI.RegisterHub("usb", errmsg)
YTilt.FirstTilt().registerValueCallback(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