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) |
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) |
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 "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]; |