Created
September 19, 2018 16:55
-
-
Save jeffkaufman/b84f7fd1f5cd99255ef767f224b65e12 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_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