Skip to content

Instantly share code, notes, and snippets.

View jeffkaufman's full-sized avatar

Jeff Kaufman jeffkaufman

View GitHub Profile
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)
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)
#import "yocto_api.h"
#import "yocto_tilt.h"
void yocto_callback(YTilt* tilt, NSString* functionValue) {
NSLog(@"Tilt: %@", functionValue);
}
void setup() {
NSError* error_ignored;
[YAPI RegisterHub:@"usb": &error_ignored];